From 132519b471376878e304b1f88f002cf0d50e76ee Mon Sep 17 00:00:00 2001 From: Jean-Marc Collin Date: Sun, 3 Nov 2024 22:12:56 +0000 Subject: [PATCH] Merge #590 and fix some tests --- tests/test_auto_start_stop.py | 16 +++++++++++++++- tests/test_config_flow.py | 6 +++--- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/tests/test_auto_start_stop.py b/tests/test_auto_start_stop.py index 07380b7..f36fe47 100644 --- a/tests/test_auto_start_stop.py +++ b/tests/test_auto_start_stop.py @@ -444,6 +444,8 @@ async def test_auto_start_stop_medium_heat_vtherm( "target_temperature": 19.0, "current_temperature": 21.0, "temperature_slope": 0.167, + "accumulated_error": -5, + "accumulated_error_threshold": 5, }, ) ] @@ -507,6 +509,8 @@ async def test_auto_start_stop_medium_heat_vtherm( "target_temperature": 19.0, "current_temperature": 18.0, "temperature_slope": -0.034, + "accumulated_error": 5, + "accumulated_error_threshold": 5, }, ) ] @@ -569,7 +573,7 @@ async def test_auto_start_stop_fast_ac_vtherm( CONF_USE_AUTO_START_STOP_FEATURE: True, CONF_USE_PRESENCE_FEATURE: True, CONF_PRESENCE_SENSOR: "binary_sensor.presence_sensor", - CONF_CLIMATE: "climate.mock_climate", + CONF_UNDERLYING_LIST: ["climate.mock_climate"], CONF_MINIMAL_ACTIVATION_DELAY: 30, CONF_SECURITY_DELAY_MIN: 5, CONF_SECURITY_MIN_ON_PERCENT: 0.3, @@ -672,6 +676,8 @@ async def test_auto_start_stop_fast_ac_vtherm( "target_temperature": 25.0, "current_temperature": 23.0, "temperature_slope": -0.28, + "accumulated_error": 2, + "accumulated_error_threshold": 2, }, ) ] @@ -734,6 +740,8 @@ async def test_auto_start_stop_fast_ac_vtherm( "target_temperature": 25.0, "current_temperature": 26.5, "temperature_slope": 0.112, + "accumulated_error": -2, + "accumulated_error_threshold": 2, }, ) ] @@ -881,6 +889,8 @@ async def test_auto_start_stop_medium_heat_vtherm_preset_change( "target_temperature": 17.0, "current_temperature": 19.0, "temperature_slope": 0.3, + "accumulated_error": -2, + "accumulated_error_threshold": 2, }, ) ] @@ -936,6 +946,8 @@ async def test_auto_start_stop_medium_heat_vtherm_preset_change( "target_temperature": 21.0, "current_temperature": 17.0, "temperature_slope": -0.087, + "accumulated_error": 2, + "accumulated_error_threshold": 2, }, ) ] @@ -1445,6 +1457,8 @@ async def test_auto_start_stop_fast_heat_window_mixed( "target_temperature": 19.0, "current_temperature": 21.0, "temperature_slope": 0.214, + "accumulated_error": -2, + "accumulated_error_threshold": 2, }, ), ] diff --git a/tests/test_config_flow.py b/tests/test_config_flow.py index c1290f6..b54d7a1 100644 --- a/tests/test_config_flow.py +++ b/tests/test_config_flow.py @@ -512,7 +512,7 @@ async def test_user_config_flow_over_climate( } assert result["result"] assert result["result"].domain == DOMAIN - assert result["result"].version == 1 + assert result["result"].version == 2 assert result["result"].title == "TheOverClimateMockName" assert isinstance(result["result"], ConfigEntry) @@ -1012,7 +1012,7 @@ async def test_user_config_flow_over_climate_auto_start_stop( result = await hass.config_entries.flow.async_configure( result["flow_id"], user_input={ - CONF_CLIMATE: "climate.mock_climate", + CONF_UNDERLYING_LIST: ["climate.mock_climate"], CONF_AC_MODE: False, CONF_AUTO_REGULATION_MODE: CONF_AUTO_REGULATION_STRONG, CONF_AUTO_REGULATION_DTEMP: 0.5, @@ -1121,6 +1121,6 @@ async def test_user_config_flow_over_climate_auto_start_stop( } assert result["result"] assert result["result"].domain == DOMAIN - assert result["result"].version == 1 + assert result["result"].version == 2 assert result["result"].title == "TheOverClimateMockName" assert isinstance(result["result"], ConfigEntry)