Fix handling of homekit_controler zeroconf c# changes (#22995)
This commit is contained in:
parent
88455a8a8b
commit
f7afd9d6bc
3 changed files with 65 additions and 3 deletions
|
@ -11,7 +11,7 @@ from homekit.model import Accessory, get_id
|
|||
from homekit.exceptions import AccessoryNotFoundError
|
||||
from homeassistant.components.homekit_controller import SERVICE_HOMEKIT
|
||||
from homeassistant.components.homekit_controller.const import (
|
||||
DOMAIN, HOMEKIT_ACCESSORY_DISPATCH)
|
||||
CONTROLLER, DOMAIN, HOMEKIT_ACCESSORY_DISPATCH)
|
||||
from homeassistant.setup import async_setup_component
|
||||
import homeassistant.util.dt as dt_util
|
||||
from tests.common import (
|
||||
|
@ -227,6 +227,30 @@ async def setup_test_accessories(hass, accessories, capitalize=False):
|
|||
return pairing
|
||||
|
||||
|
||||
async def device_config_changed(hass, accessories):
|
||||
"""Discover new devices added to HomeAssistant at runtime."""
|
||||
# Update the accessories our FakePairing knows about
|
||||
controller = hass.data[CONTROLLER]
|
||||
pairing = controller.pairings['00:00:00:00:00:00']
|
||||
pairing.accessories = accessories
|
||||
|
||||
discovery_info = {
|
||||
'host': '127.0.0.1',
|
||||
'port': 8080,
|
||||
'properties': {
|
||||
'md': 'TestDevice',
|
||||
'id': '00:00:00:00:00:00',
|
||||
'c#': '2',
|
||||
'sf': '0',
|
||||
}
|
||||
}
|
||||
|
||||
fire_service_discovered(hass, SERVICE_HOMEKIT, discovery_info)
|
||||
|
||||
# Wait for services to reconfigure
|
||||
await hass.async_block_till_done()
|
||||
|
||||
|
||||
async def setup_test_component(hass, services, capitalize=False, suffix=None):
|
||||
"""Load a fake homekit accessory based on a homekit accessory model.
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue