mirror of
https://github.com/home-assistant/core.git
synced 2025-07-24 21:57:51 +00:00
Handle timeout on pairing close in HomeKit Controller (#79133)
This commit is contained in:
parent
d991c173a2
commit
d11916758c
@ -2,6 +2,7 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
|
import contextlib
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
import aiohomekit
|
import aiohomekit
|
||||||
@ -41,7 +42,8 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
|||||||
await conn.async_setup()
|
await conn.async_setup()
|
||||||
except (AccessoryNotFoundError, EncryptionError, AccessoryDisconnectedError) as ex:
|
except (AccessoryNotFoundError, EncryptionError, AccessoryDisconnectedError) as ex:
|
||||||
del hass.data[KNOWN_DEVICES][conn.unique_id]
|
del hass.data[KNOWN_DEVICES][conn.unique_id]
|
||||||
await conn.pairing.close()
|
with contextlib.suppress(asyncio.TimeoutError):
|
||||||
|
await conn.pairing.close()
|
||||||
raise ConfigEntryNotReady from ex
|
raise ConfigEntryNotReady from ex
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
Loading…
x
Reference in New Issue
Block a user