Dont attempt to add devices to disabled zwave config #22461
Merged
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
On my install clicking "Add a z-wave device" from integrations or devices page would always hang and generate an error.
It is because this button attempts to add the device to the first config entry for zwave_js integrations. But I have two zwave_js integration config entries, the first one I disabled when I migrated from an old coordinator, and a second config entry for my new coordinator.
We should instead try to add device to the first enabled config entry (or raise a complaint if there are no enabled).
I added the same filter for zha and matter as it seemed sensical to do so, but I did not test those flows.
Type of change
Example configuration
Additional information
Checklist
If user exposed functionality or configuration variables are added/changed: