Skip to content

Commit

Permalink
Add setAuto() method to change HomeState (presenceLock) to Auto
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
chiefdragon committed Oct 16, 2022
1 parent 17a0656 commit 5c007c8
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions PyTado/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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']
Expand Down

0 comments on commit 5c007c8

Please sign in to comment.