From 5c007c8b17e1f100264d4e11f6e181eaaa685064 Mon Sep 17 00:00:00 2001 From: chiefdragon <11260692+chiefdragon@users.noreply.github.com> Date: Sun, 16 Oct 2022 18:04:21 +0100 Subject: [PATCH] Add setAuto() method to change HomeState (presenceLock) to Auto PyTado already has methods to set this to Home and Away, but no method to set / revert it to Auto mode. This change sends a DELETE request to presencelock, as does my.tado.com. --- PyTado/interface.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/PyTado/interface.py b/PyTado/interface.py index 25ddd52..f4a608f 100644 --- a/PyTado/interface.py +++ b/PyTado/interface.py @@ -370,7 +370,7 @@ def setZoneOverlay(self, zone, overlayMode, setTemp=None, duration=None, deviceT data = self._apiCall(cmd, "PUT", post_data) return data - + def getZoneOverlayDefault(self, zone): """Get current overlay default settings for zone.""" cmd = 'zones/%i/defaultOverlay' % zone @@ -390,7 +390,13 @@ def setAway(self): payload = { "homePresence": "AWAY" } data = self._apiCall(cmd, "PUT", payload) return data - + + def setAuto(self): + """Sets HomeState to AUTO """ + cmd = 'presenceLock' + data = self._apiCall(cmd, "DELETE") + return data + def getWindowState(self, zone): """Returns the state of the window for Zone zone""" data = self.getState(zone)['openWindow']