-
-
Notifications
You must be signed in to change notification settings - Fork 288
Correct double-click detection logic #676
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
Correct double-click detection logic #676
Conversation
Hey @danleongjy, thank you so much for your contribution! 🚀 🔄 We're currently running a few checks to make sure that everything is great with your contribution. Results are coming soon, stay tuned! |
Hey @EPMatt, thank you so much for your contribution! 🚀 🔄 We're currently running a few checks to make sure that everything is great with your contribution. Results are coming soon, stay tuned! |
Hey @EPMatt, ✅ Your contribution passed all the checks, awesome! Thanks again for dedicating your precious time to this project. 🔥 📝 Updated blueprints included in this PR can be tested by importing them in Home Assistant via the following links. https://github.com/danleongjy/awesome-ha-blueprints/blob/ikea_e1743_e1766_e1524_e1810_e2001_e2002/blueprints/controllers/ikea_e1524_e1810/ikea_e1524_e1810.yaml |
Thank you so much for your contribution @danleongjy! 🚀 Tested on my system, and confirmed your changes are working with Z2M. We could easily replicate the same logic on all the controller blueprints that implement virtual double press events. Would you be up to work on this? Happy to help as I can with updating docs + version number as well. Thanks again! 🔥 |
That's great to know! Sure, I will go ahead and propose changes to the other controller blueprints to use the new logic for double-press checks. Do you prefer to have 1 PR per controller or it's ok to batch all of them into 1 fresh PR? To be honest, this is my first GitHub PR, so all I can say is that the instructions and guides were quite clear to follow! |
Hey @danleongjy, A single PR with changes for all controllers sounds good to me. I'll proceed with adding the missing pieces to this PR - version bump and a Changelog entry in the docs, so you can also mirror such edits as you contribute to the other blueprints in your new PR. Thanks again for your help! 🔥 |
Hey @EPMatt, ✅ Your contribution passed all the checks, awesome! Thanks again for dedicating your precious time to this project. 🔥 📝 Updated blueprints included in this PR can be tested by importing them in Home Assistant via the following links. https://github.com/danleongjy/awesome-ha-blueprints/blob/ikea_e1743_e1766_e1524_e1810_e2001_e2002/blueprints/controllers/ikea_e1524_e1810/ikea_e1524_e1810.yaml |
…#676) * Correct double-click detection logic * feat(blueprints): bump version to 2025.04.01 * docs(blueprints): add changelog entry --------- Co-authored-by: Matteo Agnoletto <[email protected]> Co-authored-by: EPMatt <[email protected]>
Hi there, 🔒 This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. If you want to submit a contribution to the project, you can open a new PR. Thanks! |
Thank you for taking the time to work on a Pull Request. Your contribution is really appreciated! 🎉
Please don't delete any part of the template, since keeping the provided structure will help maintainers to review your work more rapidly.
Sections marked as * are required and need to be filled in.
Breaking change
helper_double_press_delay
. The button's behaviour may change from what end-users previously expected."a": "double_press"
tohelper_last_controller_event
. This PR adjustshelper_last_controller_event
to identify which button was double-pressed (eg."a": "double_press_up"
). Users implementing automations that look for"a": "double_press"
in the state ofhelper_last_controller_event
need to adjust their automations.Proposed change*
There is an issue with the logic for checking for virtual double-presses. First, the old state of the
helper_last_controller_event
is saved to variablelast_controller_event
, thenhelper_last_controller_event
is updated to the newtrigger_action
. Finally, the check for double-press uses the conditiontrigger_action | string in states(helper_last_controller_event)
. This effectively checks thattrigger_action
is in itself. As a result, if any two buttons are pressed withinhelper_double_press_delay
, a double-press action is detected, even if they are different buttons. Which double-press action is fired depends on which is the first one exposed. Changing the condition totrigger_action | string == last_controller_event
reflects the intended logic correctly and results in the intended behaviour.To enable better tracking of which button was double-pressed, the value pushed to
helper_last_controller_event
is also adjusted to be button-specific.Tested for E1810, E1743, E1766, E1812 and E2001/2002
Closes #643
Checklist*
npm run format
before submitting my Pull Request.