From 26861df98c1f7121d3f0a6f5ddf70d55b5c759c1 Mon Sep 17 00:00:00 2001 From: = <=> Date: Sun, 16 Jul 2023 22:16:47 +0000 Subject: [PATCH] fix: ensures timed openings works with on/off state as well Fixes #56 --- custom_components/dual_smart_thermostat/climate.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/custom_components/dual_smart_thermostat/climate.py b/custom_components/dual_smart_thermostat/climate.py index e8b0141..b572f43 100644 --- a/custom_components/dual_smart_thermostat/climate.py +++ b/custom_components/dual_smart_thermostat/climate.py @@ -761,7 +761,9 @@ async def _async_opening_changed(self, event): break # schdule the closing of the opening - if opening_timeout is not None and new_state.state == STATE_OPEN: + if opening_timeout is not None and ( + new_state.state == STATE_OPEN or new_state.state == STATE_ON + ): _LOGGER.debug( "Scheduling state open of opening %s in %s", opening_entity, @@ -1013,6 +1015,11 @@ def _is_opening_open(self): opening_entity, STATE_OPEN, opening[ATTR_TIMEOUT], + ) or condition.state( + self.hass, + opening_entity, + STATE_ON, + opening[ATTR_TIMEOUT], ): _is_open = True _LOGGER.debug(