mirror of
https://github.com/home-assistant/core.git
synced 2025-07-20 19:57:07 +00:00
Fix overkiz measurement sensor returns None if 0 (#105090)
This commit is contained in:
parent
3c635fdbf2
commit
be44de0a41
@ -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…
x
Reference in New Issue
Block a user