1
0
mirror of https://github.com/home-assistant/core.git synced 2026-05-08 17:49:37 +01:00

Fix Climate state reproduction when target temperature is None (#156220)

This commit is contained in:
Michael
2025-11-09 23:29:46 +01:00
committed by GitHub
parent 8d50754056
commit 9ec3aee8aa
2 changed files with 4 additions and 3 deletions
@@ -57,9 +57,9 @@ async def _async_reproduce_states(
await call_service(SERVICE_SET_HVAC_MODE, [], {ATTR_HVAC_MODE: state.state})
if (
(ATTR_TEMPERATURE in state.attributes)
or (ATTR_TARGET_TEMP_HIGH in state.attributes)
or (ATTR_TARGET_TEMP_LOW in state.attributes)
(state.attributes.get(ATTR_TEMPERATURE) is not None)
or (state.attributes.get(ATTR_TARGET_TEMP_HIGH) is not None)
or (state.attributes.get(ATTR_TARGET_TEMP_LOW) is not None)
):
await call_service(
SERVICE_SET_TEMPERATURE,
@@ -127,6 +127,7 @@ async def test_attribute(hass: HomeAssistant, service, attribute) -> None:
(SERVICE_SET_SWING_MODE, ATTR_SWING_MODE),
(SERVICE_SET_SWING_HORIZONTAL_MODE, ATTR_SWING_HORIZONTAL_MODE),
(SERVICE_SET_FAN_MODE, ATTR_FAN_MODE),
(SERVICE_SET_TEMPERATURE, ATTR_TEMPERATURE),
],
)
async def test_attribute_with_none(hass: HomeAssistant, service, attribute) -> None: