-
Notifications
You must be signed in to change notification settings - Fork 506
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
Eria adurolight remote support #4495
Eria adurolight remote support #4495
Conversation
…ch to VENDOR_ADUROLIGHT.
…less Dimming Switch.
The pattern for this addition was based off of the Sengled Smart Light Switch / E1E-G7F.
…an event for Button 1 for any button pressed. This switch has a situation where it sends the same endpoint/cluster/command ID for every button pressed and only makes the distinction between buttons via payload value. The current logic in `DeRestPluginPrivate::checkSensorButtonEvent()` currently does not support this type of distinction, and the button map (field dresden-elektronik#5) only seems to support the first digit of the payload value and not the full payload value. Therefore all of the information that distinguishes between the buttons ends up being ignored and the button events are being sent as the first mapped entry (button 1). This commit changes the logic within `DeRestPluginPrivate::checkSensorButtonEvent()` to allow the value of the button pressed to be modified once a valid mapped entry has been found, and adds specific logic for the Eria Adurosmart Wireless Dimming Switch to change the button value based off of the payload value.
Please note the change in 4da5cc8 which is a little unconventional as the current logic is essentially ignoring the button map as this remote has a situation where it sends the same endpoint/cluster/command ID for every button pressed and only makes the distinction between buttons via payload value.
Ideally this type of situation should have an extra value (or modify the existing 5th value) in the button maps to allow for identification of the FULL payload to distinguish the types of buttons pressed. I'm open to suggestions and/or I can help test any changes. |
…negates the need to add a special case for this model as it is properly added further down in the `else if (!node->nodeDescriptor().isNull())` block.
I'm afraid all what's required is the creation of the button map and the addition of the manufacturer specific cluster at the right place, all other amendments are superfluous. Also, the referred to PRs have the MFC VENDOR_JENNIC, so that would mean people running those would probably end up with non-working devices. |
The button map alone doesn't solve the problem as the following logic... deconz-rest-plugin/de_web_plugin.cpp Lines 4251 to 4260 in f3aec7b
...will ALWAYS select the FIRST button map entry EVERY time no matter what button is pressed. This is because the check above is only checking mode, endpoint, cluster ID, and command ID which is identical for every entry in this remote's button map. The only difference I am receiving in button presses is the payload value. I believe this is the same issue as #4413. Refer to this comment for the output of the If placing the "manufacturer specific cluster at the right place" could avoid this situation I am all for making the appropriate changes, but I would need to be shown where to make these changes as I could not find anywhere else that would translate specific payloads to different buttons.
Are you referring to changing If you want, I can reverse commits 486ce64 and e403df9 which would return the vendor prefix back to JENNIC and make a special case for model |
I stay brief here and apparently, I missed your feedback on the previous PR. Your code is "just" working as it benefits from a logic flaw allowing incomplete button maps to be stored in memory. Incomplete in this sense because you added a 3 Bytes payload, which is disallowed and also throws errors in the debug log right after starting deconz. Apparently, a for-loop is not exited appropriately.
To not loop all the back and forth through, how about if I quickly put the required parts together and you check'em? |
Is this referring to the I could technically change all of those values to
Thanks that would help. Are you implying that you will make your own pull request for this issue and I will review and ensure it works for me?
Fair enough, I will reverse commits 486ce64 and e403df9 (unless you're making your own PR). |
Check out #4580 |
I just tested the Eria remote with that branch and it works! Thanks for I think I understand now how your approach works, essentially it loops through all of the button map entries and you're essentially setting the I'm closing this PR in favor of your branch. |
I guess the whole function is a bit... clumsy and could use a decent overhaul. I haven't dared that yet since mistakes would have quite some impact. It was already painful enough when I introduced the button maps due to other than obvious hidden dependencies. |
Refer to issues: #1730 and #3383
Refer to previous Pull Request #4211
These changes allow the Eria Adurosmart remote to send events for each button press.
From what I can tell there is no distinction from the remote for holding the button or double clicking, so this just provides simple button presses.