Ensure shared zeroconf is passed to homekit controller devices (#38678)

This commit is contained in:
J. Nick Koston 2020-08-08 15:37:05 -05:00 committed by GitHub
parent 02d572aae5
commit e304792f3a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -11,6 +11,7 @@ from aiohomekit.model.characteristics import (
) )
from aiohomekit.model.services import Service, ServicesTypes from aiohomekit.model.services import Service, ServicesTypes
from homeassistant.components import zeroconf
from homeassistant.exceptions import ConfigEntryNotReady from homeassistant.exceptions import ConfigEntryNotReady
from homeassistant.helpers import device_registry as dr from homeassistant.helpers import device_registry as dr
from homeassistant.helpers.entity import Entity from homeassistant.helpers.entity import Entity
@ -212,7 +213,8 @@ async def async_setup(hass, config):
map_storage = hass.data[ENTITY_MAP] = EntityMapStorage(hass) map_storage = hass.data[ENTITY_MAP] = EntityMapStorage(hass)
await map_storage.async_initialize() await map_storage.async_initialize()
hass.data[CONTROLLER] = aiohomekit.Controller() zeroconf_instance = await zeroconf.async_get_instance(hass)
hass.data[CONTROLLER] = aiohomekit.Controller(zeroconf_instance=zeroconf_instance)
hass.data[KNOWN_DEVICES] = {} hass.data[KNOWN_DEVICES] = {}
return True return True