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 GitHub
parent 5dac5d5c7e
commit 16a90f8f19
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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(