Handle occassional 502 Bad Gateway from SimpliSafe (#22131)

pull/22141/head
Aaron Bach 2019-03-17 11:55:10 -06:00 committed by GitHub
parent ba923d2d66
commit 0d42ed1861
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 1 deletions

View File

@ -109,7 +109,13 @@ async def async_setup_entry(hass, config_entry):
"""Refresh data from the SimpliSafe account."""
for system in systems:
_LOGGER.debug('Updating system data: %s', system.system_id)
await system.update()
try:
await system.update()
except SimplipyError as err:
_LOGGER.error('There was an error while updating: %s', err)
return
async_dispatcher_send(hass, TOPIC_UPDATE.format(system.system_id))
if system.api.refresh_token_dirty: