From 8060c3ed9652e04fc80265fe68816e1a10bd64b9 Mon Sep 17 00:00:00 2001 From: Josh Anderson Date: Tue, 19 Oct 2021 17:31:36 +0100 Subject: [PATCH] Expose overlay termination timestamp data --- PyTado/zone.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/PyTado/zone.py b/PyTado/zone.py index d8b44b5..17704ed 100644 --- a/PyTado/zone.py +++ b/PyTado/zone.py @@ -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 @@ -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.""" @@ -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