Retry tado setup later when cloud service is unavailable (#39748)

This commit is contained in:
J. Nick Koston 2020-09-07 09:16:29 -05:00 committed by GitHub
parent 4b84b74b89
commit 8c96eb7c56
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -91,6 +91,8 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry):
except RuntimeError as exc: except RuntimeError as exc:
_LOGGER.error("Failed to setup tado: %s", exc) _LOGGER.error("Failed to setup tado: %s", exc)
return ConfigEntryNotReady return ConfigEntryNotReady
except requests.exceptions.Timeout as ex:
raise ConfigEntryNotReady from ex
except requests.exceptions.HTTPError as ex: except requests.exceptions.HTTPError as ex:
if ex.response.status_code > 400 and ex.response.status_code < 500: if ex.response.status_code > 400 and ex.response.status_code < 500:
_LOGGER.error("Failed to login to tado: %s", ex) _LOGGER.error("Failed to login to tado: %s", ex)