Add known devices to USB Vendor / Product IDs (#54986)

Co-authored-by: kpine <keith.pine@gmail.com>
This commit is contained in:
J. Nick Koston 2021-08-21 14:56:49 -05:00 committed by GitHub
parent 5329dccd8b
commit 0403ea715e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 32 additions and 13 deletions

View File

@ -16,10 +16,10 @@
"zigpy-znp==0.5.3"
],
"usb": [
{"vid":"10C4","pid":"EA60"},
{"vid":"1CF1","pid":"0030"},
{"vid":"1A86","pid":"7523"},
{"vid":"10C4","pid":"8A2A"}
{"vid":"10C4","pid":"EA60","known_devices":["slae.sh cc2652rb stick"]},
{"vid":"1CF1","pid":"0030","known_devices":["Conbee II"]},
{"vid":"1A86","pid":"7523","known_devices":["Electrolama zig-a-zig-ah"]},
{"vid":"10C4","pid":"8A2A","known_devices":["Nortek HUSBZB-1"]}
],
"codeowners": ["@dmulcahey", "@adminiuga"],
"zeroconf": [

View File

@ -8,8 +8,8 @@
"dependencies": ["usb", "http", "websocket_api"],
"iot_class": "local_push",
"usb": [
{"vid":"0658","pid":"0200"},
{"vid":"10C4","pid":"8A2A"},
{"vid":"10C4","pid":"EA60"}
{"vid":"0658","pid":"0200","known_devices":["Aeotec Z-Stick Gen5+", "Z-WaveMe UZB"]},
{"vid":"10C4","pid":"8A2A","known_devices":["Nortek HUSBZB-1"]},
{"vid":"10C4","pid":"EA60","known_devices":["Aeotec Z-Stick 7", "Silicon Labs UZB-7", "Zooz ZST10 700"]}
]
}

View File

@ -230,7 +230,12 @@ async def async_get_usb(hass: HomeAssistant) -> list[dict[str, str]]:
if not integration.usb:
continue
for entry in integration.usb:
usb.append({"domain": integration.domain, **entry})
usb.append(
{
"domain": integration.domain,
**{k: v for k, v in entry.items() if k != "known_devices"},
}
)
return usb

View File

@ -210,6 +210,7 @@ MANIFEST_SCHEMA = vol.Schema(
{
vol.Optional("vid"): vol.All(str, verify_uppercase),
vol.Optional("pid"): vol.All(str, verify_uppercase),
vol.Optional("known_devices"): [str],
}
)
],

View File

@ -33,7 +33,12 @@ def generate_and_validate(integrations: list[dict[str, str]]) -> str:
continue
for entry in match_types:
match_list.append({"domain": domain, **entry})
match_list.append(
{
"domain": domain,
**{k: v for k, v in entry.items() if k != "known_devices"},
}
)
return BASE.format(json.dumps(match_list, indent=4))

View File

@ -369,10 +369,18 @@ def _get_test_integration_with_usb_matcher(hass, name, config_flow):
"dependencies": [],
"requirements": [],
"usb": [
{"vid": "10C4", "pid": "EA60"},
{"vid": "1CF1", "pid": "0030"},
{"vid": "1A86", "pid": "7523"},
{"vid": "10C4", "pid": "8A2A"},
{
"vid": "10C4",
"pid": "EA60",
"known_devices": ["slae.sh cc2652rb stick"],
},
{"vid": "1CF1", "pid": "0030", "known_devices": ["Conbee II"]},
{
"vid": "1A86",
"pid": "7523",
"known_devices": ["Electrolama zig-a-zig-ah"],
},
{"vid": "10C4", "pid": "8A2A", "known_devices": ["Nortek HUSBZB-1"]},
],
},
)