mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 04:07:08 +00:00
Fix reversed logic in zeroconf homekit pairing check (#35596)
* Fix reversed logic in zeroconf homekit pairing check * s/server_info/service_info/
This commit is contained in:
parent
b7ab07c987
commit
a42a654590
@ -178,6 +178,11 @@ def setup(hass, config):
|
||||
return
|
||||
|
||||
service_info = zeroconf.get_service_info(service_type, name)
|
||||
if not service_info:
|
||||
# Prevent the browser thread from collapsing as
|
||||
# service_info can be None
|
||||
return
|
||||
|
||||
info = info_from_service(service_info)
|
||||
_LOGGER.debug("Discovered new device %s %s", name, info)
|
||||
|
||||
@ -196,7 +201,8 @@ def setup(hass, config):
|
||||
and HOMEKIT_PAIRED_STATUS_FLAG in info[HOMEKIT_PROPERTIES]
|
||||
):
|
||||
try:
|
||||
if not int(info[HOMEKIT_PROPERTIES][HOMEKIT_PAIRED_STATUS_FLAG]):
|
||||
# 0 means paired and not discoverable by iOS clients)
|
||||
if int(info[HOMEKIT_PROPERTIES][HOMEKIT_PAIRED_STATUS_FLAG]):
|
||||
return
|
||||
except ValueError:
|
||||
# HomeKit pairing status unknown
|
||||
|
@ -18,8 +18,8 @@ PROPERTIES = {
|
||||
NON_ASCII_KEY: None,
|
||||
}
|
||||
|
||||
HOMEKIT_STATUS_UNPAIRED = b"0"
|
||||
HOMEKIT_STATUS_PAIRED = b"1"
|
||||
HOMEKIT_STATUS_UNPAIRED = b"1"
|
||||
HOMEKIT_STATUS_PAIRED = b"0"
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
|
Loading…
x
Reference in New Issue
Block a user