Fix overkiz measurement sensor returns None if 0 (#105090)
This commit is contained in:
parent
3c635fdbf2
commit
be44de0a41
1 changed files with 6 additions and 1 deletions
|
@ -481,7 +481,12 @@ class OverkizStateSensor(OverkizDescriptiveEntity, SensorEntity):
|
|||
"""Return the value of the sensor."""
|
||||
state = self.device.states.get(self.entity_description.key)
|
||||
|
||||
if not state or not state.value:
|
||||
if (
|
||||
state is None
|
||||
or state.value is None
|
||||
or self.state_class != SensorStateClass.MEASUREMENT
|
||||
and not state.value
|
||||
):
|
||||
return None
|
||||
|
||||
# Transform the value with a lambda function
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue