Skip to content
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

ubisys: Allow to configure device inputs using templates #1658

Merged

Conversation

felixstorm
Copy link
Contributor

This makes general usage and especially direct ZigBee binding of the ubisys C4 a lot easier since there is no need anymore to dive into the raw input configuration attributes. It is also helpful for other ubisys devices to e.g. change the inputs from expecting push buttons to stationary switches.

Also see: Koenkk/zigbee2mqtt#3911 (comment)

Another PR for the documentation update will come in also in a few minutes.

Thanks,
Felix

if (value.hasOwnProperty('inputActions')) {
// example (default for C4): [[0,13,1,6,0,2], [1,13,2,6,0,2], [2,13,3,6,0,2], [3,13,4,6,0,2]]
await devMgmtEp.write('manuSpecificUbisysDeviceSetup',
{'inputActions': {elementType: 'octetStr', elements: value.inputActions}});
}

if (value.hasOwnProperty('inputActionTemplates')) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, can you make sure everything is snake case? e.g. inputActionTemplates -> input_action_templates.

inputActions = templateType.getInputActions(input, endpoint, template);
} else {
// scene(s) (always single input)
if (!template.hasOwnProperty('sceneId')) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also sceneId -> scene_id, groupId -> group_id.

@Koenkk
Copy link
Owner

Koenkk commented Oct 13, 2020

Note to self; after this merge Koenkk/zigbee2mqtt.io#420

@felixstorm felixstorm force-pushed the ubisys_device_setup_inputActionsTemplates branch from 666d0cf to 2f9fd45 Compare October 14, 2020 16:23
@felixstorm
Copy link
Contributor Author

@Koenkk Should be ok like this, no? I also updated the docs PR accordingly.

Only my branch name ubisys_device_setup_inputActionsTemplates still has some camel case left in it, but I guess thats ok 😉

@Koenkk
Copy link
Owner

Koenkk commented Oct 14, 2020

Perfect, thanks again!

@Koenkk Koenkk merged commit 1e22380 into Koenkk:master Oct 14, 2020
@sjorge
Copy link
Contributor

sjorge commented Oct 14, 2020

Nice!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants