Fix upb config flow connect (#121571)

This commit is contained in:
Glenn Waters 2024-07-09 02:32:34 -04:00 committed by GitHub
parent 3ea694a069
commit b07fcb6a4a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -39,12 +39,13 @@ async def _validate_input(data):
url = _make_url_from_data(data) url = _make_url_from_data(data)
upb = upb_lib.UpbPim({"url": url, "UPStartExportFile": file_path}) upb = upb_lib.UpbPim({"url": url, "UPStartExportFile": file_path})
upb.connect(_connected_callback)
if not upb.config_ok: if not upb.config_ok:
_LOGGER.error("Missing or invalid UPB file: %s", file_path) _LOGGER.error("Missing or invalid UPB file: %s", file_path)
raise InvalidUpbFile raise InvalidUpbFile
upb.connect(_connected_callback)
with suppress(TimeoutError): with suppress(TimeoutError):
async with asyncio.timeout(VALIDATE_TIMEOUT): async with asyncio.timeout(VALIDATE_TIMEOUT):
await connected_event.wait() await connected_event.wait()