-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
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
Add zwave_js.set_config_parameter service #46673
Add zwave_js.set_config_parameter service #46673
Conversation
Hey there @home-assistant/z-wave, mind taking a look at this pull request as its been labeled with an integration ( |
Nice work on this! I actually started working on this but you've beat me to it haha :-) I was just thinking.. How would users know what values exist and what values to set ?
BTW: I also agree with you that we should try to mimic the behavior of previous integrations. We now have a chance to do this right. In that light, I kind of prefer the first option where we just accept the value label as it appears in the UI |
Attempting to summarize the Discord conversation as a reference. We want to support setting config parameters with the following service data schemes, using an enumerated/bitwise parameter as an example (https://devices.zwave-js.io/?jumpTo=0x000c:0x0203:0x0001:0.0 parameter 31) Scenario 1: Update a partial value by bit, accepts a value of either the number or the label: parameter: 31
bitmask: 0x01
value: 1/Blink Scenario 2: Update a partial value by label, accepts a value of either the number or the label: parameter: LED 1 Blink Status (bottom)
value: 1/Blink Scenario 3: Update all bitwise values using a value dict (key can be either the bit or the label, value can be either the number or the label): parameter: 31
value:
0x01: 1/Blink
0x02: 1/Blink parameter: 31
value:
"LED 1 Blink Status (bottom)": 1/Blink
"LED 2 Blink Status": 1/Blink Scenario 4: Update all bitwise values using raw value: parameter: 31
value: 3 Most of these will require additional upstream changes to support, but hopefully that encapsulates all use cases |
I like the proposal. A couple observations. parameter: LED 1 Blink Status (bottom)
value: 1/Blink This assumes that no parameters (or even partials for different parameters) for a node have the same label (property). I hope that's true in all cases, but should we confirm? parameter: 31
value:
"LED 1 Blink Status (bottom)": 1/Blink
"LED 2 Blink Status": 1/Blink If I was setting only "LED 1 Blink Status (bottom)", then I don't care about parameter 31, but now when I want to set more than one I know need to know that. I don't have a better idea though, just an observation. At least this does avoid any problems with possible duplicate labels (a partial can't possibly have duplicate labels right?). |
I think the duplicate label is OK since the user can just use the parameter/property number as a fallback. Regarding your second point, we can make |
I don't have a real strong opinion on it. As proposed, it's probably fine. |
OK so we now have |
9bf2a44
to
761b54f
Compare
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.
Are we sure the helpers that were moved from the service module will be used elsewhere?
Co-authored-by: Franck Nijhof <[email protected]>
Co-authored-by: Franck Nijhof <[email protected]>
Co-authored-by: Franck Nijhof <[email protected]>
Co-authored-by: Franck Nijhof <[email protected]>
Co-authored-by: Franck Nijhof <[email protected]>
Co-authored-by: Franck Nijhof <[email protected]>
30fec97
to
7d17381
Compare
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.
Looks good!
There's a merge conflict. Sorry about that. |
Proposed change
Adds new
zwave_js.set_config_parameter
serviceType of change
Additional information
Checklist
black --fast 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
.The integration reached or maintains the following Integration Quality Scale:
To help with the load of incoming pull requests: