mirror of
https://github.com/home-assistant/core.git
synced 2025-08-10 08:05:06 +02:00
Avoid errors when AirNow API does not return all expected pollutants (#60232)
Co-authored-by: Aaron Bach <bachya1208@gmail.com>
This commit is contained in:
@@ -86,7 +86,8 @@ class AirNowSensor(CoordinatorEntity, SensorEntity):
|
|||||||
@property
|
@property
|
||||||
def native_value(self):
|
def native_value(self):
|
||||||
"""Return the state."""
|
"""Return the state."""
|
||||||
self._state = self.coordinator.data[self.entity_description.key]
|
self._state = self.coordinator.data.get(self.entity_description.key)
|
||||||
|
|
||||||
return self._state
|
return self._state
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
Reference in New Issue
Block a user