Hide ZWA-2 adapter in Zigbee serial port selector #155526
Draft
+77
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Proposed change
Change ZHA's config flow to ignore the Home Assistant Connect ZWA-2 (Z-Wave) adapter in the serial port selector.
This is done by implementing a new
IGNORED_USB_DEVICESset with(manufacturer, usb_description)tuples and known Nabu Casa Z-Wave adapter names (ZWA-2).Additional notes
Something similar was already done for the Z-Wave integration with:
for Filter out known non Z-Wave devices from serial port selector zwave-js/backlog#137
Similar explanation on implementation to Z-Wave PR (CLICK TO OPEN)
Note: We cannot use VID/PID for this, as ZWA-2 and early ZBT-2 units share the same VID/PID.
For the Z-Wave PR linked below, I've also looked at fetching this info from USB discovery for Home Assistant hardware and ZHA/Z-Wave integrations, but that adds a lot of complexity and weird dependencies. This simple solution seems better and avoids any false-positives (e.g. ignoring a Zigbee + Z-Wave adapter with the same USB info).
In the future, we wanna look at implementing a (custom) serial port selector in the frontend, also used by integrations for other Open Home Protocols. This/similar logic might be moved to that serial port selector then.
For now, this PR implements a simple way of hiding known non Zigbee devices. Other manufacturers can also be added.
Semi-related backlog issue:
Type of change
Additional information
Checklist
ruff format homeassistant tests)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest.requirements_all.txt.Updated by running
python3 -m script.gen_requirements_all.To help with the load of incoming pull requests: