-
-
Notifications
You must be signed in to change notification settings - Fork 28.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix zwave_js discovery logic for node device class #117232
Conversation
Hey there @home-assistant/z-wave, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
…7232) * Fix zwave_js discovery logic for node device class * simplify check
Proposed change
We discovered a bug in the device class portion of the
async_discover_single_value
validation checks. A node with anull
device class and a Multilevel Switch CCcurrentValue
value should be discovered as a light, but it was being discovered as a cover. This is because the cover and light discovery schemas watch for the same value, but the cover schema requires the node to have particular device classes. Since the node's device class wasNone
, the device class check was being skipped, which meant that in this scenario, the cover and light discovery schemas were effectively identical. Because cover is first in the list, it became the new discovery schema to match the value when it should have been a light.There seems to have been a change in the driver that results in
deviceClass
beingNone
in more scenarios. I'll log an issue in the node-zwave-js repo. CC @AlCalzoneThe test I added fails before this fix and passes after.
Thanks @kpine for tracking down the culprit(s) of this 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
..coveragerc
.To help with the load of incoming pull requests: