mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 11:17:21 +00:00
Ignore some HomeKit devices (#15316)
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.
This commit is contained in:
parent
4c6394b307
commit
c587536547
@ -26,6 +26,12 @@ HOMEKIT_ACCESSORY_DISPATCH = {
|
|||||||
'thermostat': 'climate',
|
'thermostat': 'climate',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
HOMEKIT_IGNORE = [
|
||||||
|
'BSB002',
|
||||||
|
'Home Assistant Bridge',
|
||||||
|
'TRADFRI gateway'
|
||||||
|
]
|
||||||
|
|
||||||
KNOWN_ACCESSORIES = "{}-accessories".format(DOMAIN)
|
KNOWN_ACCESSORIES = "{}-accessories".format(DOMAIN)
|
||||||
KNOWN_DEVICES = "{}-devices".format(DOMAIN)
|
KNOWN_DEVICES = "{}-devices".format(DOMAIN)
|
||||||
|
|
||||||
@ -237,6 +243,9 @@ def setup(hass, config):
|
|||||||
hkid = discovery_info['properties']['id']
|
hkid = discovery_info['properties']['id']
|
||||||
config_num = int(discovery_info['properties']['c#'])
|
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
|
# Only register a device once, but rescan if the config has changed
|
||||||
if hkid in hass.data[KNOWN_DEVICES]:
|
if hkid in hass.data[KNOWN_DEVICES]:
|
||||||
device = hass.data[KNOWN_DEVICES][hkid]
|
device = hass.data[KNOWN_DEVICES][hkid]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user