From bbe7a602cc333d4c5468cc3e372bd89c4cb3e1bf Mon Sep 17 00:00:00 2001 From: Germain Lefebvre <7525033+germainlefebvre4@users.noreply.github.com> Date: Fri, 13 Oct 2023 18:02:24 +0200 Subject: [PATCH] fix(api): Put Zone Order (#200) --- libtado/api.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/libtado/api.py b/libtado/api.py index 3ba386b..6d556fb 100644 --- a/libtado/api.py +++ b/libtado/api.py @@ -1923,3 +1923,24 @@ def set_heating_system_boiler(self, payload): """ return self._api_call('homes/%i/heatingSystem/boiler' % (self.id), data=payload, method='PUT') + + def set_zone_order(self, payload, ngsw_bypass=True): + """ + Set zone order + + Parameters: + zoneOrder (list): List of zone IDs in the order you want them to appear in the app. + + Returns: + No returned value. + + Example: + ```json + [ + {"id": 1}, + {"id": 6}, + {"id": 12} + ] + ``` + """ + return self._api_call('homes/%i/zoneOrder?ngsw-bypass=%s' % (self.id, ngsw_bypass), data=payload, method='PUT')