-
Notifications
You must be signed in to change notification settings - Fork 21
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 utility function to bulk set partial config parameters #176
Add utility function to bulk set partial config parameters #176
Conversation
One thing to note is that Al has stated that he'd like to add native support for this type of action in |
FYI |
Results from the test if anyone wants them. Test device
Test Results{ type: 'result',
success: true,
messageId: 'set-parameter',
result: { success: true } }
{ type: 'event',
event:
{ source: 'node',
event: 'value updated',
nodeId: 27,
args:
{ commandClassName: 'Configuration',
commandClass: 112,
property: 8,
propertyKey: 255,
newValue: 190,
prevValue: 21,
propertyName: 'LED Effect Color' } } }
{ type: 'event',
event:
{ source: 'node',
event: 'value updated',
nodeId: 27,
args:
{ commandClassName: 'Configuration',
commandClass: 112,
property: 8,
propertyKey: 65280,
newValue: 10,
prevValue: 10,
propertyName: 'LED Effect Brightness' } } }
{ type: 'event',
event:
{ source: 'node',
event: 'value updated',
nodeId: 27,
args:
{ commandClassName: 'Configuration',
commandClass: 112,
property: 8,
propertyKey: 16711680,
newValue: 25,
prevValue: 10,
propertyName: 'LED Effect Duration' } } }
{ type: 'event',
event:
{ source: 'node',
event: 'value updated',
nodeId: 27,
args:
{ commandClassName: 'Configuration',
commandClass: 112,
property: 8,
propertyKey: 2130706432,
newValue: 3,
prevValue: 4,
propertyName: 'LED Effect Type' } } } |
Co-authored-by: Martin Hjelmare <[email protected]>
Co-authored-by: Martin Hjelmare <[email protected]>
What do we need to change if zwave-js adds more native support for this feature? |
Not sure, because I am not sure what adding more native support means. I'm guessing that the main change would be to not calculate the raw value to send by doing the bit shift operations and just passing the individual bitmasks and values directly to zwave-js. All the other validation I would think we want to do in the library because we can raise more relevant exceptions to the caller |
Ok, so there's no risk of breaking changes for the user if this would happen? |
I can't guarantee that there will be no breaking change in the future, but I don't believe so. This method should work as long as the |
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.
Ok, looks good!
This has been an in demand request for some time. The new function will either accept a raw integer value or a dictionary of
{bitmask: value}
and will convert the dictionary to the raw integer value before calling thenode.set_value
command.The logic all works, what I am not sure of is if we can useEDIT: Tests confirmed that we can in fact usenode.set_value
to bulk set parameters. I asked @petro to test this for me because I don't have any nodes with partial parametersnode.set_value
to bulk set parameters, so this PR is good to merge