Recover fast when homekit_controller sees a zeroconf announcment for a device that is offline (#51038)

pull/51081/head
J. Nick Koston 2021-05-25 11:47:45 -05:00 committed by GitHub
parent 98535c9e6c
commit 9f22509a4b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -238,6 +238,11 @@ class HomekitControllerFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
# (config_num) for changes. If it changes, we check for new entities
if paired and hkid in self.hass.data.get(KNOWN_DEVICES, {}):
conn = self.hass.data[KNOWN_DEVICES][hkid]
# When we rediscover the device, let aiohomekit know
# that the device is available and we should not wait
# to retry connecting any longer. reconnect_soon
# will do nothing if the device is already connected
await conn.pairing.connection.reconnect_soon()
if conn.config_num != config_num:
_LOGGER.debug(
"HomeKit info %s: c# incremented, refreshing entities", hkid