Fixes an AirVisual bug where response data is missing (#16673)

pull/16568/merge
Aaron Bach 2018-09-17 14:44:18 -06:00 committed by GitHub
parent 25712f16b3
commit 27d50d388f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -281,7 +281,7 @@ class AirVisualData:
_LOGGER.debug("New data retrieved: %s", resp) _LOGGER.debug("New data retrieved: %s", resp)
self.pollution_info = resp['current']['pollution'] self.pollution_info = resp['current']['pollution']
except AirVisualError as err: except (KeyError, AirVisualError) as err:
if self.city and self.state and self.country: if self.city and self.state and self.country:
location = (self.city, self.state, self.country) location = (self.city, self.state, self.country)
else: else: