mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 05:07:41 +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"
|
return "mdi:radiator"
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def native_value(self) -> int:
|
def native_value(self) -> int | None:
|
||||||
"""Return the state of the radiator valve."""
|
"""Return the state of the radiator valve."""
|
||||||
if self._device.valveState != ValveState.ADAPTION_DONE:
|
if self._device.valveState != ValveState.ADAPTION_DONE:
|
||||||
return self._device.valveState
|
return None
|
||||||
return round(self._device.valvePosition * 100)
|
return round(self._device.valvePosition * 100)
|
||||||
|
|
||||||
|
|
||||||
|
@ -29,6 +29,7 @@ from homeassistant.const import (
|
|||||||
PERCENTAGE,
|
PERCENTAGE,
|
||||||
POWER_WATT,
|
POWER_WATT,
|
||||||
SPEED_KILOMETERS_PER_HOUR,
|
SPEED_KILOMETERS_PER_HOUR,
|
||||||
|
STATE_UNKNOWN,
|
||||||
TEMP_CELSIUS,
|
TEMP_CELSIUS,
|
||||||
)
|
)
|
||||||
from homeassistant.setup import async_setup_component
|
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")
|
await async_manipulate_test_data(hass, hmip_device, "valveState", "nn")
|
||||||
ha_state = hass.states.get(entity_id)
|
ha_state = hass.states.get(entity_id)
|
||||||
assert ha_state.state == "nn"
|
assert ha_state.state == STATE_UNKNOWN
|
||||||
|
|
||||||
await async_manipulate_test_data(
|
await async_manipulate_test_data(
|
||||||
hass, hmip_device, "valveState", ValveState.ADAPTION_DONE
|
hass, hmip_device, "valveState", ValveState.ADAPTION_DONE
|
||||||
|
Loading…
x
Reference in New Issue
Block a user