Increase isy setup timeout to 60s (#51559)

- Ensure errors are displayed in the UI
pull/51573/head
J. Nick Koston 2021-06-06 23:49:37 -10:00 committed by GitHub
parent 85ce679c64
commit 75dffee312
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 15 deletions

View File

@ -172,14 +172,12 @@ async def async_setup_entry(
)
try:
async with async_timeout.timeout(30):
async with async_timeout.timeout(60):
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
raise ConfigEntryNotReady(
f"Timed out initializing the ISY; device may be busy, trying again later: {err}"
) from err
except ISYInvalidAuthError as err:
_LOGGER.error(
"Invalid credentials for the ISY, please adjust settings and try again: %s",
@ -187,16 +185,13 @@ async def async_setup_entry(
)
return False
except ISYConnectionError as err:
_LOGGER.error(
"Failed to connect to the ISY, please adjust settings and try again: %s",
err,
)
raise ConfigEntryNotReady from err
raise ConfigEntryNotReady(
f"Failed to connect to the ISY, please adjust settings and try again: {err}"
) from err
except ISYResponseParseError as err:
_LOGGER.warning(
"Error processing responses from the ISY; device may be busy, trying again later"
)
raise ConfigEntryNotReady from err
raise ConfigEntryNotReady(
f"Invalid XML response from ISY; Ensure the ISY is running the latest firmware: {err}"
) from err
_categorize_nodes(hass_isy_data, isy.nodes, ignore_identifier, sensor_identifier)
_categorize_programs(hass_isy_data, isy.programs)