mirror of
https://github.com/home-assistant/core.git
synced 2025-08-06 22:25:13 +02:00
Fix overkiz measurement sensor returns None if 0 (#105090)
This commit is contained in:
committed by
Franck Nijhof
parent
ae4811b776
commit
f7c9d20472
@@ -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
|
||||
|
Reference in New Issue
Block a user