Skip to content

Commit

Permalink
Ignore some HomeKit devices (home-assistant#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 michaeldavie committed Jul 31, 2018
1 parent 7a08da3 commit 6225a40
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 6225a40

Please sign in to comment.