mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 12:17:07 +00:00
Fix Hue sensors returning None value (#23478)
This commit is contained in:
parent
f1b2622d78
commit
26bf1b2173
@ -32,6 +32,9 @@ class HueLightLevel(GenericHueGaugeSensorEntity):
|
||||
@property
|
||||
def state(self):
|
||||
"""Return the state of the device."""
|
||||
if self.sensor.lightlevel is None:
|
||||
return None
|
||||
|
||||
# https://developers.meethue.com/develop/hue-api/supported-devices/#clip_zll_lightlevel
|
||||
# Light level in 10000 log10 (lux) +1 measured by sensor. Logarithm
|
||||
# scale used because the human eye adjusts to light levels and small
|
||||
@ -59,4 +62,7 @@ class HueTemperature(GenericHueGaugeSensorEntity):
|
||||
@property
|
||||
def state(self):
|
||||
"""Return the state of the device."""
|
||||
if self.sensor.temperature is None:
|
||||
return None
|
||||
|
||||
return self.sensor.temperature / 100
|
||||
|
Loading…
x
Reference in New Issue
Block a user