Error handling when connection refused (#6614)

Add an optional extended description…
This commit is contained in:
Erik Eriksson 2017-03-14 10:08:40 +01:00 committed by Pascal Vizeli
parent f58941a0d4
commit c4e151f621

View file

@ -108,7 +108,9 @@ class Dovado:
"""Update device state."""
_LOGGER.info("Updating")
try:
self.state.update(self._dovado.state or {})
self.state = self._dovado.state or {}
if not self.state:
return False
self.state.update(
connected=self.state.get("modem status") == "CONNECTED")
_LOGGER.debug("Received: %s", self.state)