mirror of
https://github.com/home-assistant/core.git
synced 2025-04-29 19:57:52 +00:00
Pass in the bleak scanner instance to HKC (#75636)
This commit is contained in:
parent
8e86124470
commit
edaebcd85d
@ -3,10 +3,10 @@
|
||||
"name": "HomeKit Controller",
|
||||
"config_flow": true,
|
||||
"documentation": "https://www.home-assistant.io/integrations/homekit_controller",
|
||||
"requirements": ["aiohomekit==1.1.9"],
|
||||
"requirements": ["aiohomekit==1.1.10"],
|
||||
"zeroconf": ["_hap._tcp.local.", "_hap._udp.local."],
|
||||
"bluetooth": [{ "manufacturer_id": 76, "manufacturer_data_start": [6] }],
|
||||
"after_dependencies": ["zeroconf"],
|
||||
"dependencies": ["bluetooth", "zeroconf"],
|
||||
"codeowners": ["@Jc2k", "@bdraco"],
|
||||
"iot_class": "local_push",
|
||||
"loggers": ["aiohomekit", "commentjson"]
|
||||
|
@ -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
|
||||
|
||||
|
@ -168,7 +168,7 @@ aioguardian==2022.07.0
|
||||
aioharmony==0.2.9
|
||||
|
||||
# homeassistant.components.homekit_controller
|
||||
aiohomekit==1.1.9
|
||||
aiohomekit==1.1.10
|
||||
|
||||
# homeassistant.components.emulated_hue
|
||||
# homeassistant.components.http
|
||||
|
@ -152,7 +152,7 @@ aioguardian==2022.07.0
|
||||
aioharmony==0.2.9
|
||||
|
||||
# homeassistant.components.homekit_controller
|
||||
aiohomekit==1.1.9
|
||||
aiohomekit==1.1.10
|
||||
|
||||
# homeassistant.components.emulated_hue
|
||||
# homeassistant.components.http
|
||||
|
@ -37,3 +37,8 @@ def controller(hass):
|
||||
@pytest.fixture(autouse=True)
|
||||
def hk_mock_async_zeroconf(mock_async_zeroconf):
|
||||
"""Auto mock zeroconf."""
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def auto_mock_bluetooth(mock_bluetooth):
|
||||
"""Auto mock bluetooth."""
|
||||
|
Loading…
x
Reference in New Issue
Block a user