Prepare homekit_controller for _hap._udp.local. (#74857)
* Prepare homekit_controller for _hap._udp.local.
This commit is contained in:
parent
c9aa3c112a
commit
59170d3c54
7 changed files with 34 additions and 7 deletions
|
@ -8,6 +8,7 @@ from typing import Any
|
|||
import aiohomekit
|
||||
from aiohomekit.exceptions import AuthenticationError
|
||||
from aiohomekit.model import Accessories, CharacteristicsTypes, ServicesTypes
|
||||
from aiohomekit.utils import domain_supported, domain_to_name
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant import config_entries
|
||||
|
@ -203,8 +204,12 @@ class HomekitControllerFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
|
|||
hkid = properties[zeroconf.ATTR_PROPERTIES_ID]
|
||||
normalized_hkid = normalize_hkid(hkid)
|
||||
|
||||
# If this aiohomekit doesn't support this particular device, ignore it.
|
||||
if not domain_supported(discovery_info.name):
|
||||
return self.async_abort(reason="ignored_model")
|
||||
|
||||
model = properties["md"]
|
||||
name = discovery_info.name.replace("._hap._tcp.local.", "")
|
||||
name = domain_to_name(discovery_info.name)
|
||||
status_flags = int(properties["sf"])
|
||||
paired = not status_flags & 0x01
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue