From 9a6c99264e466a70b3444fa08ed51786d487d427 Mon Sep 17 00:00:00 2001 From: pavoni Date: Tue, 16 Feb 2016 12:05:00 +0000 Subject: [PATCH] Catch KeyError as well as ValueError when handling efergy errors. --- homeassistant/components/sensor/efergy.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homeassistant/components/sensor/efergy.py b/homeassistant/components/sensor/efergy.py index 8eba0149408..23023b90fe1 100644 --- a/homeassistant/components/sensor/efergy.py +++ b/homeassistant/components/sensor/efergy.py @@ -97,5 +97,5 @@ class EfergySensor(Entity): self._state = response.json()['sum'] else: self._state = 'Unknown' - except (RequestException, ValueError): + except (RequestException, ValueError, KeyError): _LOGGER.warning('Could not update status for %s', self.name)