Skip to content

Commit

Permalink
Ignore some HomeKit devices (#15316)
Browse files Browse the repository at this point in the history
There are some devices that speak HomeKit that we shouldn't expose. Some
bridges (such as the Hue) provide reduced functionality over HomeKit and
have a functional native API, so should be ignored. We also shouldn't
offer to configure the built-in Home Assistant HomeKit bridge.
  • Loading branch information
mjg59 authored and balloob committed Jul 12, 2018
1 parent 4c6394b commit c587536
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions homeassistant/components/homekit_controller/__init__.py
Expand Up @@ -26,6 +26,12 @@
'thermostat': 'climate',
}

HOMEKIT_IGNORE = [
'BSB002',
'Home Assistant Bridge',
'TRADFRI gateway'
]

KNOWN_ACCESSORIES = "{}-accessories".format(DOMAIN)
KNOWN_DEVICES = "{}-devices".format(DOMAIN)

Expand Down Expand Up @@ -237,6 +243,9 @@ def discovery_dispatch(service, discovery_info):
hkid = discovery_info['properties']['id']
config_num = int(discovery_info['properties']['c#'])

if model in HOMEKIT_IGNORE:
return

# Only register a device once, but rescan if the config has changed
if hkid in hass.data[KNOWN_DEVICES]:
device = hass.data[KNOWN_DEVICES][hkid]
Expand Down

0 comments on commit c587536

Please sign in to comment.