Hide HomeKit devices from discovery that are known to be problematic (#44014)

This commit is contained in:
Jc2k 2020-12-07 12:51:35 +00:00 committed by GitHub
parent 727b1d37b6
commit 6ce45e39d1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 27 additions and 0 deletions

View file

@ -257,6 +257,21 @@ async def test_discovery_ignored_model(hass, controller):
"""Already paired."""
device = setup_mock_accessory(controller)
discovery_info = get_device_discovery_info(device)
discovery_info["properties"]["id"] = "AA:BB:CC:DD:EE:FF"
discovery_info["properties"]["md"] = "HHKBridge1,1"
# Device is discovered
result = await hass.config_entries.flow.async_init(
"homekit_controller", context={"source": "zeroconf"}, data=discovery_info
)
assert result["type"] == "abort"
assert result["reason"] == "ignored_model"
async def test_discovery_ignored_hk_bridge(hass, controller):
"""Already paired."""
device = setup_mock_accessory(controller)
discovery_info = get_device_discovery_info(device)
config_entry = MockConfigEntry(domain=config_flow.HOMEKIT_BRIDGE_DOMAIN, data={})
formatted_mac = device_registry.format_mac("AA:BB:CC:DD:EE:FF")