From 0d42ed18612a7a3ab574c5cd1086f0e62a210bc6 Mon Sep 17 00:00:00 2001 From: Aaron Bach Date: Sun, 17 Mar 2019 11:55:10 -0600 Subject: [PATCH] Handle occassional 502 Bad Gateway from SimpliSafe (#22131) --- homeassistant/components/simplisafe/__init__.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/simplisafe/__init__.py b/homeassistant/components/simplisafe/__init__.py index f494ccf390e..73a4c61a6ab 100644 --- a/homeassistant/components/simplisafe/__init__.py +++ b/homeassistant/components/simplisafe/__init__.py @@ -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: