Skip to content

Commit

Permalink
Merge pull request #49 from andersonshatch/overlay_termination_time
Browse files Browse the repository at this point in the history
Expose overlay termination timestamp
  • Loading branch information
Wolfgang Malgadey authored Oct 28, 2021
2 parents 88bdeea + 8060c3e commit a0ddde9
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions PyTado/zone.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ def __init__(self, data, zone_id):
self._tado_mode = None
self._overlay_active = None
self._overlay_termination_type = None
self._overlay_termination_timestamp = None
self._preparation = None
self._open_window = None
self._open_window_detected = None
Expand Down Expand Up @@ -108,6 +109,11 @@ def overlay_termination_type(self):
"""Overlay termination type (what happens when period ends)."""
return self._overlay_termination_type

@property
def overlay_termination_time(self):
"""Overlay termination time."""
return self._overlay_termination_timestamp

@property
def current_humidity(self):
"""Humidity of the zone."""
Expand Down Expand Up @@ -317,12 +323,14 @@ def update_data(self, data):
# If there is no overlay
# then we are running the smart schedule
self._overlay_termination_type = None
self._overlay_termination_timestamp = None
if "overlay" in data and data["overlay"] is not None:
if (
"termination" in data["overlay"]
and "type" in data["overlay"]["termination"]
):
self._overlay_termination_type = data["overlay"]["termination"]["type"]
self._overlay_termination_timestamp = data["overlay"]["termination"].get('expiry',None)
else:
self._current_hvac_mode = CONST_MODE_SMART_SCHEDULE

Expand Down

0 comments on commit a0ddde9

Please sign in to comment.