diff --git a/homeassistant/components/homematicip_cloud/sensor.py b/homeassistant/components/homematicip_cloud/sensor.py index b4eb89f06c8..04fba2cfd92 100644 --- a/homeassistant/components/homematicip_cloud/sensor.py +++ b/homeassistant/components/homematicip_cloud/sensor.py @@ -177,10 +177,10 @@ class HomematicipHeatingThermostat(HomematicipGenericEntity, SensorEntity): return "mdi:radiator" @property - def native_value(self) -> int: + def native_value(self) -> int | None: """Return the state of the radiator valve.""" if self._device.valveState != ValveState.ADAPTION_DONE: - return self._device.valveState + return None return round(self._device.valvePosition * 100) diff --git a/tests/components/homematicip_cloud/test_sensor.py b/tests/components/homematicip_cloud/test_sensor.py index 33da0f217ae..b4da2a83c38 100644 --- a/tests/components/homematicip_cloud/test_sensor.py +++ b/tests/components/homematicip_cloud/test_sensor.py @@ -29,6 +29,7 @@ from homeassistant.const import ( PERCENTAGE, POWER_WATT, SPEED_KILOMETERS_PER_HOUR, + STATE_UNKNOWN, TEMP_CELSIUS, ) from homeassistant.setup import async_setup_component @@ -82,7 +83,7 @@ async def test_hmip_heating_thermostat(hass, default_mock_hap_factory): await async_manipulate_test_data(hass, hmip_device, "valveState", "nn") ha_state = hass.states.get(entity_id) - assert ha_state.state == "nn" + assert ha_state.state == STATE_UNKNOWN await async_manipulate_test_data( hass, hmip_device, "valveState", ValveState.ADAPTION_DONE