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

View File

@ -8,8 +8,8 @@
"dependencies": ["usb", "http", "websocket_api"], "dependencies": ["usb", "http", "websocket_api"],
"iot_class": "local_push", "iot_class": "local_push",
"usb": [ "usb": [
{"vid":"0658","pid":"0200"}, {"vid":"0658","pid":"0200","known_devices":["Aeotec Z-Stick Gen5+", "Z-WaveMe UZB"]},
{"vid":"10C4","pid":"8A2A"}, {"vid":"10C4","pid":"8A2A","known_devices":["Nortek HUSBZB-1"]},
{"vid":"10C4","pid":"EA60"} {"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: if not integration.usb:
continue continue
for entry in integration.usb: 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 return usb

View File

@ -210,6 +210,7 @@ MANIFEST_SCHEMA = vol.Schema(
{ {
vol.Optional("vid"): vol.All(str, verify_uppercase), vol.Optional("vid"): vol.All(str, verify_uppercase),
vol.Optional("pid"): 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 continue
for entry in match_types: 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)) 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": [], "dependencies": [],
"requirements": [], "requirements": [],
"usb": [ "usb": [
{"vid": "10C4", "pid": "EA60"}, {
{"vid": "1CF1", "pid": "0030"}, "vid": "10C4",
{"vid": "1A86", "pid": "7523"}, "pid": "EA60",
{"vid": "10C4", "pid": "8A2A"}, "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"]},
], ],
}, },
) )