Improve isy994 sensor typing (#137077)
parent
278c35f830
commit
1157a08f72
|
@ -198,14 +198,13 @@ class ISYSensorEntity(ISYNodeEntity, SensorEntity):
|
|||
|
||||
# Handle ISY precision and rounding
|
||||
value = convert_isy_value_to_hass(value, uom, self.target.prec)
|
||||
if value is None:
|
||||
return None
|
||||
|
||||
# Convert temperatures to Home Assistant's unit
|
||||
if uom in (UnitOfTemperature.CELSIUS, UnitOfTemperature.FAHRENHEIT):
|
||||
value = self.hass.config.units.temperature(value, uom)
|
||||
|
||||
if value is None:
|
||||
return None
|
||||
|
||||
assert isinstance(value, (int, float))
|
||||
return value
|
||||
|
||||
|
|
Loading…
Reference in New Issue