Catch AttributeError (#4253)

This commit is contained in:
William Scanlon 2016-11-06 19:04:57 -05:00 committed by Paulus Schoutsen
parent 734bd75fd3
commit 0aba227300
2 changed files with 2 additions and 2 deletions

View file

@ -61,7 +61,7 @@ class WinkBinarySensorDevice(WinkDevice, BinarySensorDevice, Entity):
json_data = message
self.wink.pubnub_update(json.loads(json_data))
self.update_ha_state()
except (AttributeError, KeyError):
except (AttributeError, KeyError, AttributeError):
error = "Pubnub returned invalid json for " + self.name
logging.getLogger(__name__).error(error)
self.update_ha_state(True)

View file

@ -111,7 +111,7 @@ class WinkDevice(Entity):
try:
self.wink.pubnub_update(json.loads(message))
self.update_ha_state()
except (AttributeError, KeyError):
except (AttributeError, KeyError, AttributeError):
error = "Pubnub returned invalid json for " + self.name
logging.getLogger(__name__).error(error)
self.update_ha_state(True)