Retry isy994 setup later if isy.initialize times out (#51453)

Maybe fixes https://forum.universal-devices.com/topic/26633-home-assistant-isy-component/?do=findComment&comment=312147
This commit is contained in:
J. Nick Koston 2021-06-03 20:54:45 -10:00 committed by GitHub
parent e5c70c8789
commit 5fc1822b43
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,6 +1,7 @@
"""Support the ISY-994 controllers."""
from __future__ import annotations
import asyncio
from urllib.parse import urlparse
from aiohttp import CookieJar
@ -171,8 +172,14 @@ async def async_setup_entry(
)
try:
with async_timeout.timeout(30):
async with async_timeout.timeout(30):
await isy.initialize()
except asyncio.TimeoutError as err:
_LOGGER.error(
"Timed out initializing the ISY; device may be busy, trying again later: %s",
err,
)
raise ConfigEntryNotReady from err
except ISYInvalidAuthError as err:
_LOGGER.error(
"Invalid credentials for the ISY, please adjust settings and try again: %s",