Catch KeyError as well as ValueError when handling efergy errors.
parent
1d7aea7120
commit
9a6c99264e
|
@ -97,5 +97,5 @@ class EfergySensor(Entity):
|
||||||
self._state = response.json()['sum']
|
self._state = response.json()['sum']
|
||||||
else:
|
else:
|
||||||
self._state = 'Unknown'
|
self._state = 'Unknown'
|
||||||
except (RequestException, ValueError):
|
except (RequestException, ValueError, KeyError):
|
||||||
_LOGGER.warning('Could not update status for %s', self.name)
|
_LOGGER.warning('Could not update status for %s', self.name)
|
||||||
|
|
Loading…
Reference in New Issue