Fix WAQI being zero (#97767)

This commit is contained in:
Joost Lekkerkerker 2023-08-04 12:46:23 +02:00 committed by Franck Nijhof
parent d71f16c8b1
commit 3b48c8a0f5
No known key found for this signature in database
GPG Key ID: D62583BA8AB11CA3

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