Fix stalls in config flow of APCUPSD (#108931)

Fix deadlock in config flow of APCUPSD
This commit is contained in:
Yuxin Wang 2024-01-27 02:34:29 -05:00 committed by Franck Nijhof
parent b66339dbfe
commit 0532c4343a
No known key found for this signature in database
GPG Key ID: D62583BA8AB11CA3

View File

@ -52,9 +52,8 @@ class ConfigFlowHandler(ConfigFlow, domain=DOMAIN):
# Test the connection to the host and get the current status for serial number.
coordinator = APCUPSdCoordinator(self.hass, host, port)
await coordinator.async_request_refresh()
await self.hass.async_block_till_done()
if isinstance(coordinator.last_exception, (UpdateFailed, asyncio.TimeoutError)):
errors = {"base": "cannot_connect"}
return self.async_show_form(