Increase isy setup timeout to 60s (#51559)

- Ensure errors are displayed in the UI
This commit is contained in:
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

View File

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