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

Add wrap around support in counter component #23207

Open
wants to merge 5 commits into
base: dev
Choose a base branch
from

Conversation

CrazyVito11
Copy link

@CrazyVito11 CrazyVito11 commented Dec 7, 2024

Proposed change

This change allows users to configure the new wrap around option in the counter component.

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.

Warning

The required core changes haven't been released yet at the time of writing this.
See the related Core PR at Additional information

image
image

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (thank you!)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Example configuration

counter:
  bedroom_scene_switcher:
    name: Bedroom scene switcher counter
    initial: 0
    step: 1
    minimum: 0
    maximum: 3
    wrap_around: true

Additional information

Checklist

  • The code change is tested and works locally.
  • There is no commented out code in this PR.
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

@home-assistant home-assistant bot marked this pull request as draft December 10, 2024 14:10
@home-assistant
Copy link

Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍

Learn more about our pull request process.

@CrazyVito11 CrazyVito11 marked this pull request as ready for review December 10, 2024 17:50
@home-assistant home-assistant bot requested a review from MindFreeze December 10, 2024 17:50
@home-assistant home-assistant bot marked this pull request as draft December 11, 2024 07:17
@CrazyVito11 CrazyVito11 marked this pull request as ready for review December 11, 2024 10:11
@home-assistant home-assistant bot requested a review from MindFreeze December 11, 2024 10:11
MindFreeze
MindFreeze previously approved these changes Dec 11, 2024
@marcinbauer85
Copy link
Contributor

@CrazyVito11 This dialog has an additional toggle "Restore the last known value when home assistant starts". Not sure why it's missing in your screenshot. The switch should be at the bottom of the content, and I would advice to rename it to something less technical like "Loop". As I understand it when a counter counts up or down to the min or max, once it reaches that limit it starts from the initial value?
image

Here's a design:
https://www.figma.com/design/yRb6Og2gfbYHVrnzn7NQU2/HA-23?node-id=2-110&t=sJ07fSwmaTvgxbgs-11

CC: @MindFreeze

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

Successfully merging this pull request may close these issues.

5 participants