Avoid errors when AirNow API does not return all expected pollutants (#60232)

Co-authored-by: Aaron Bach <bachya1208@gmail.com>
pull/60241/head
J.P. Krauss 2021-11-23 12:54:53 -08:00 committed by GitHub
parent a3bf56c11d
commit 2d29ef9b63
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -86,7 +86,8 @@ class AirNowSensor(CoordinatorEntity, SensorEntity):
@property
def native_value(self):
"""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
@property