mirror of
https://github.com/home-assistant/core.git
synced 2025-07-25 06:07:17 +00:00
Improve isy994 sensor typing (#137077)
This commit is contained in:
parent
278c35f830
commit
1157a08f72
@ -198,14 +198,13 @@ class ISYSensorEntity(ISYNodeEntity, SensorEntity):
|
|||||||
|
|
||||||
# Handle ISY precision and rounding
|
# Handle ISY precision and rounding
|
||||||
value = convert_isy_value_to_hass(value, uom, self.target.prec)
|
value = convert_isy_value_to_hass(value, uom, self.target.prec)
|
||||||
|
if value is None:
|
||||||
|
return None
|
||||||
|
|
||||||
# Convert temperatures to Home Assistant's unit
|
# Convert temperatures to Home Assistant's unit
|
||||||
if uom in (UnitOfTemperature.CELSIUS, UnitOfTemperature.FAHRENHEIT):
|
if uom in (UnitOfTemperature.CELSIUS, UnitOfTemperature.FAHRENHEIT):
|
||||||
value = self.hass.config.units.temperature(value, uom)
|
value = self.hass.config.units.temperature(value, uom)
|
||||||
|
|
||||||
if value is None:
|
|
||||||
return None
|
|
||||||
|
|
||||||
assert isinstance(value, (int, float))
|
assert isinstance(value, (int, float))
|
||||||
return value
|
return value
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user