mirror of
https://github.com/home-assistant/core.git
synced 2025-07-14 00:37:13 +00:00
Return None for fields not reported in Sensibo (#67693)
This commit is contained in:
parent
af7670a5a5
commit
a8baebee8d
@ -146,7 +146,7 @@ class SensiboClimate(SensiboBaseEntity, ClimateEntity):
|
||||
return features
|
||||
|
||||
@property
|
||||
def current_humidity(self) -> int:
|
||||
def current_humidity(self) -> int | None:
|
||||
"""Return the current humidity."""
|
||||
return self.coordinator.data[self.unique_id]["humidity"]
|
||||
|
||||
@ -168,7 +168,7 @@ class SensiboClimate(SensiboBaseEntity, ClimateEntity):
|
||||
]
|
||||
|
||||
@property
|
||||
def current_temperature(self) -> float:
|
||||
def current_temperature(self) -> float | None:
|
||||
"""Return the current temperature."""
|
||||
return convert_temperature(
|
||||
self.coordinator.data[self.unique_id]["temp"],
|
||||
|
@ -52,8 +52,8 @@ class SensiboDataUpdateCoordinator(DataUpdateCoordinator):
|
||||
unique_id = dev["id"]
|
||||
mac = dev["macAddress"]
|
||||
name = dev["room"]["name"]
|
||||
temperature = dev["measurements"].get("temperature", 0.0)
|
||||
humidity = dev["measurements"].get("humidity", 0)
|
||||
temperature = dev["measurements"].get("temperature")
|
||||
humidity = dev["measurements"].get("humidity")
|
||||
ac_states = dev["acState"]
|
||||
target_temperature = ac_states.get("targetTemperature")
|
||||
hvac_mode = ac_states.get("mode")
|
||||
@ -95,8 +95,8 @@ class SensiboDataUpdateCoordinator(DataUpdateCoordinator):
|
||||
fw_type = dev["firmwareType"]
|
||||
model = dev["productModel"]
|
||||
|
||||
calibration_temp = dev["sensorsCalibration"].get("temperature", 0.0)
|
||||
calibration_hum = dev["sensorsCalibration"].get("humidity", 0.0)
|
||||
calibration_temp = dev["sensorsCalibration"].get("temperature")
|
||||
calibration_hum = dev["sensorsCalibration"].get("humidity")
|
||||
|
||||
device_data[unique_id] = {
|
||||
"id": unique_id,
|
||||
|
@ -90,7 +90,7 @@ class SensiboNumber(SensiboBaseEntity, NumberEntity):
|
||||
)
|
||||
|
||||
@property
|
||||
def value(self) -> float:
|
||||
def value(self) -> float | None:
|
||||
"""Return the value from coordinator data."""
|
||||
return self.coordinator.data[self._device_id][self.entity_description.key]
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user