mirror of
https://github.com/home-assistant/core.git
synced 2025-07-09 06:17:07 +00:00
Allow SimpliSafe startup to retry on failure (#50211)
* Allow SimpliSafe startup to retry on failure * Update __init__.py * Black Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
This commit is contained in:
parent
5ec09eab42
commit
fec02c88af
@ -213,11 +213,14 @@ async def async_setup_entry(hass, config_entry): # noqa: C901
|
|||||||
|
|
||||||
_async_save_refresh_token(hass, config_entry, api.refresh_token)
|
_async_save_refresh_token(hass, config_entry, api.refresh_token)
|
||||||
|
|
||||||
simplisafe = hass.data[DOMAIN][DATA_CLIENT][config_entry.entry_id] = SimpliSafe(
|
simplisafe = SimpliSafe(hass, api, config_entry)
|
||||||
hass, api, config_entry
|
|
||||||
)
|
|
||||||
await simplisafe.async_init()
|
|
||||||
|
|
||||||
|
try:
|
||||||
|
await simplisafe.async_init()
|
||||||
|
except SimplipyError as err:
|
||||||
|
raise ConfigEntryNotReady from err
|
||||||
|
|
||||||
|
hass.data[DOMAIN][DATA_CLIENT][config_entry.entry_id] = simplisafe
|
||||||
hass.config_entries.async_setup_platforms(config_entry, PLATFORMS)
|
hass.config_entries.async_setup_platforms(config_entry, PLATFORMS)
|
||||||
|
|
||||||
@callback
|
@callback
|
||||||
|
Loading…
x
Reference in New Issue
Block a user