From 5fc1822b43261ac4b5d477c001b3c29457c67614 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Thu, 3 Jun 2021 20:54:45 -1000 Subject: [PATCH] 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 --- homeassistant/components/isy994/__init__.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/isy994/__init__.py b/homeassistant/components/isy994/__init__.py index 27d81a671c8..99905e4d946 100644 --- a/homeassistant/components/isy994/__init__.py +++ b/homeassistant/components/isy994/__init__.py @@ -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",