mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 20:27:08 +00:00
Fix unknown data in homematicip_cloud (#85618)
This commit is contained in:
parent
7621c450c7
commit
a7647fee28
@ -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)
|
||||
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user