mirror of
https://github.com/home-assistant/core.git
synced 2025-07-13 16:27:08 +00:00
Catch AttributeError (#4253)
This commit is contained in:
parent
734bd75fd3
commit
0aba227300
@ -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)
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user