Fix WAQI being zero (#97767)

This commit is contained in:
Joost Lekkerkerker
2023-08-04 12:46:23 +02:00
committed by GitHub
parent 2820514c33
commit ecce601d3f

View File

@@ -142,7 +142,7 @@ class WaqiSensor(SensorEntity):
@property
def native_value(self):
"""Return the state of the device."""
if value := self._data.get("aqi"):
if (value := self._data.get("aqi")) is not None:
with suppress(ValueError):
return float(value)
return None