From 27d50d388fe61e38f5623d0e63c4bdc28764ebe2 Mon Sep 17 00:00:00 2001 From: Aaron Bach Date: Mon, 17 Sep 2018 14:44:18 -0600 Subject: [PATCH] Fixes an AirVisual bug where response data is missing (#16673) --- homeassistant/components/sensor/airvisual.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homeassistant/components/sensor/airvisual.py b/homeassistant/components/sensor/airvisual.py index dcd89ccb78a..6837b9e1b2f 100644 --- a/homeassistant/components/sensor/airvisual.py +++ b/homeassistant/components/sensor/airvisual.py @@ -281,7 +281,7 @@ class AirVisualData: _LOGGER.debug("New data retrieved: %s", resp) self.pollution_info = resp['current']['pollution'] - except AirVisualError as err: + except (KeyError, AirVisualError) as err: if self.city and self.state and self.country: location = (self.city, self.state, self.country) else: