diff --git a/homeassistant/components/climate/reproduce_state.py b/homeassistant/components/climate/reproduce_state.py index d38e243cb62..0f965e5a9e9 100644 --- a/homeassistant/components/climate/reproduce_state.py +++ b/homeassistant/components/climate/reproduce_state.py @@ -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, diff --git a/tests/components/climate/test_reproduce_state.py b/tests/components/climate/test_reproduce_state.py index 3bc91467f14..abd8630056c 100644 --- a/tests/components/climate/test_reproduce_state.py +++ b/tests/components/climate/test_reproduce_state.py @@ -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: