mirror of
https://github.com/home-assistant/core.git
synced 2025-10-18 08:09:33 +00:00
Pass in the bleak scanner instance to HKC (#75636)
This commit is contained in:
@@ -3,7 +3,7 @@ from typing import cast
|
||||
|
||||
from aiohomekit import Controller
|
||||
|
||||
from homeassistant.components import zeroconf
|
||||
from homeassistant.components import bluetooth, zeroconf
|
||||
from homeassistant.const import EVENT_HOMEASSISTANT_STOP
|
||||
from homeassistant.core import Event, HomeAssistant
|
||||
|
||||
@@ -28,7 +28,12 @@ async def async_get_controller(hass: HomeAssistant) -> Controller:
|
||||
if existing := hass.data.get(CONTROLLER):
|
||||
return cast(Controller, existing)
|
||||
|
||||
controller = Controller(async_zeroconf_instance=async_zeroconf_instance)
|
||||
bleak_scanner_instance = bluetooth.async_get_scanner(hass)
|
||||
|
||||
controller = Controller(
|
||||
async_zeroconf_instance=async_zeroconf_instance,
|
||||
bleak_scanner_instance=bleak_scanner_instance,
|
||||
)
|
||||
|
||||
hass.data[CONTROLLER] = controller
|
||||
|
||||
|
Reference in New Issue
Block a user