esphome / esphome/feature-requests
Provide an option for the "wrapping around" of the selected menu item when the limits are reached
Nobody has claimed this yet.
- Dominant language
- No language data
- Stars
- 450
- Forks
- 29
- PR merge metrics
- No merged PRs in 30d
Description
Describe the problem you have/What new integration you would like
Provide an option (or collection of options) which provide the ability to decide what to do when the down action is invoked when the last menu item is already selected (or up for the first item). These new options would allow for an opt-in to wrap the selection around to the other limit (i.e., last → first, first → last).
Please describe your use case for this integration and alternatives you've tried:
All of the necessary ivars and/or methods for introspecting the current state of the menu or attempting to control it (outside of the limited up, down, left, right) are protected in the code right now, so I wasn't even able to write my own helper function(s) to get around this issue.
I could create my own custom component, but that is really overkill for this capability.
Additional context
I have a very limited user interface (display and a single button) and I am trying to implement the most basic of user interaction for a menu:
- long press to bring up the menu (when not active)
- long press to enter the menu item (when the menu is active)
- single click to move to the next item. If the last item has been reached, the selection should wrap around to the first item.
If the public API on the menu component allows for selected item introspection and control, then that is likely a more broad solution that would allow this feature request to be implemented with my own logic.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the menu component's handling of the up and down actions, including how the selected item is exposed or controlled. The work is done when an opt-in behavior wraps the selection from last to first and first to last, or the public API supports implementing that behavior externally.
Written by the indexing model from the issue text.
Assessment
- Domain
- embedded-iot
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100