From d1ef83f422818b2bd4d318467cdbdc10ff6b0780 Mon Sep 17 00:00:00 2001 From: Jean-Marc Collin Date: Sat, 18 Jan 2025 16:34:44 +0100 Subject: [PATCH] `hvac_off_reason` could stay at `auto_start_stop` when the VTherm is 'on' (hvac_mode=Heat) (#840) Fixes #828 Co-authored-by: Jean-Marc Collin --- .../versatile_thermostat/feature_auto_start_stop_manager.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/custom_components/versatile_thermostat/feature_auto_start_stop_manager.py b/custom_components/versatile_thermostat/feature_auto_start_stop_manager.py index 8708563..775cd53 100644 --- a/custom_components/versatile_thermostat/feature_auto_start_stop_manager.py +++ b/custom_components/versatile_thermostat/feature_auto_start_stop_manager.py @@ -70,6 +70,10 @@ def post_init(self, entry_infos: ConfigData): self._auto_start_stop_level, self.name ) + # Fix an eventual incoherent state + if self._vtherm.is_on and self._vtherm.hvac_off_reason == HVAC_OFF_REASON_AUTO_START_STOP: + self._vtherm.hvac_off_reason = None + @overrides async def start_listening(self): """Start listening the underlying entity"""