Handle TimeoutError during HKC setup attempts (#80399)

closes https://github.com/Jc2k/aiohomekit/issues/188
This commit is contained in:
J. Nick Koston 2022-10-16 02:14:15 -10:00 committed by GitHub
parent 29e110d416
commit 40600991b3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -40,7 +40,12 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
try:
await conn.async_setup()
except (AccessoryNotFoundError, EncryptionError, AccessoryDisconnectedError) as ex:
except (
asyncio.TimeoutError,
AccessoryNotFoundError,
EncryptionError,
AccessoryDisconnectedError,
) as ex:
del hass.data[KNOWN_DEVICES][conn.unique_id]
with contextlib.suppress(asyncio.TimeoutError):
await conn.pairing.close()