From 5b64a8fba03bce4e98cbd52af483c3796fa32297 Mon Sep 17 00:00:00 2001 From: Jean-Marc Collin Date: Mon, 18 Nov 2024 08:09:00 +0000 Subject: [PATCH] Add #602 - implement a max_on_percent setting --- custom_components/versatile_thermostat/thermostat_climate.py | 5 ++++- tests/test_auto_start_stop.py | 2 +- tests/test_overclimate.py | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/custom_components/versatile_thermostat/thermostat_climate.py b/custom_components/versatile_thermostat/thermostat_climate.py index 993831ca..5ad134ea 100644 --- a/custom_components/versatile_thermostat/thermostat_climate.py +++ b/custom_components/versatile_thermostat/thermostat_climate.py @@ -921,7 +921,10 @@ async def check_auto_start_stop(self): # Stop here return False - elif action == AUTO_START_STOP_ACTION_ON: + elif ( + action == AUTO_START_STOP_ACTION_ON + and self.hvac_off_reason == HVAC_OFF_REASON_AUTO_START_STOP + ): _LOGGER.info( "%s - Turning ON the Vtherm due to auto-start-stop conditions", self ) diff --git a/tests/test_auto_start_stop.py b/tests/test_auto_start_stop.py index f36fe472..87d16e44 100644 --- a/tests/test_auto_start_stop.py +++ b/tests/test_auto_start_stop.py @@ -1401,7 +1401,7 @@ async def test_auto_start_stop_fast_heat_window_mixed( assert vtherm.hvac_off_reason == HVAC_OFF_REASON_WINDOW_DETECTION assert vtherm._saved_hvac_mode == HVACMode.HEAT - assert mock_send_event.call_count == 2 + assert mock_send_event.call_count == 1 assert vtherm.window_state == STATE_ON diff --git a/tests/test_overclimate.py b/tests/test_overclimate.py index c5a1a5af..8026daf6 100644 --- a/tests/test_overclimate.py +++ b/tests/test_overclimate.py @@ -972,7 +972,7 @@ async def test_manual_hvac_off_should_take_the_lead_over_window( assert vtherm.hvac_off_reason == HVAC_OFF_REASON_WINDOW_DETECTION assert vtherm._saved_hvac_mode == HVACMode.HEAT - assert mock_send_event.call_count == 2 + assert mock_send_event.call_count == 1 assert vtherm.window_state == STATE_ON