-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
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 wrap around support in counter component #132575
base: dev
Are you sure you want to change the base?
Conversation
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.
Hi @CrazyVito11
It seems you haven't yet signed a CLA. Please do so here.
Once you do that we will be able to review and accept this pull request.
Thanks!
Hey there @fabaff, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
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.
We discussed this in the core meeting, and we found that the use case to go through scenes would technically also be possible using a select or input_select and the select.next
service (maybe has a different name, haven't checked).
So would it be possible to add some use cases for other scenarios where you could use this?
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍 |
You could potentially also use this for reminding yourself to do maintenance after X amount of cycles, without having to set the counter to the maximum value again manually in the automation. Example case 1 Example case 2 The upside of the counter being able to wrap around automatically, is that if you ever want to change the amount of cycles, you only have to update the counter's max value, and not also the |
Proposed change
This PR implements my own feature request I made on the community form a couple of months ago.
It adds an option to allow the counter component to wrap around once it reached it's minimum or maximum value.
The idea here is that it allows you to make it easier to wrap through lists, like for example a button that lists through scenes.
Right now I already have an automation that does this scene switching, but I have to manually reset the counter once I reach the end. This PR should automate that.
Type of change
Additional information
Checklist
ruff format homeassistant tests
)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest
.requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
.To help with the load of incoming pull requests: