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

Set a specific time in modifications #21

Closed
SAOPP opened this issue Sep 9, 2021 · 10 comments
Closed

Set a specific time in modifications #21

SAOPP opened this issue Sep 9, 2021 · 10 comments

Comments

@SAOPP
Copy link

SAOPP commented Sep 9, 2021

It would be great if we could specify a specific amount of time left, for example 10 seconds before the end:

                - greater_than_eq: 94
                  active_icon: mdi:timer-10

In above example, I find 10 seconds like 94% from my 3 minutes timer :)

@rianadon
Copy link
Owner

Hmm this is a good suggestion.

I predict once I allow for specifying a specific amount of time left, I'll get another issue specifying for a specific amount of time elapsed. I'm going to have to think about how I can support all these cases and not make the configuration schema too crazy.

@SAOPP
Copy link
Author

SAOPP commented Sep 12, 2021

Thanks! :)

@SAOPP
Copy link
Author

SAOPP commented Sep 12, 2021

Btw, I sat and testing different timers, and for example a timer with five minutes, I couldn't guess the percentage that will be = 10 seconds, 96 is 11 seconds, and 95 is 8 :(

@rianadon
Copy link
Owner

I think fractions should work, if you want to try something like 95.5!

@SAOPP
Copy link
Author

SAOPP commented Sep 12, 2021

Oh, thanks homie, I will try this. 👍

@SAOPP
Copy link
Author

SAOPP commented Sep 13, 2021

- greater_than: 96.5 works for me! :) Timer with 5 minutes - 96.5 it's mean 10 second 'till end. 😃

@SAOPP
Copy link
Author

SAOPP commented Sep 13, 2021

Btw, just now it dawned on me, I thought that I was picking up icons with percentages equal to 10 seconds, ok, but what if I use different values ​​in automations, and assign a different timer interval depending, for example, on the time of day - then... then, my proposal really has a sense :)

@rianadon
Copy link
Owner

I think I finally have a good syntax for this:

modifications:
  - elapsed: 40% # equivalent to the old way of greater_than_eq: 40
    bar_foreground: orange
    active_icon: mdi:fire
    bar_height: 12px
    
  - elapsed: 00:00:50 # at least 50 seconds since the timer started
    bar_foreground: red
    active_icon: mdi:fire-alert

  - remaining: 00:00:10 # when timer has 10 seconds remaining or less
    ...

 - remaining: 1% # when timer has 1% of duration remaining or less
    ...

I'm removing greater_than but keeping greater_than_eq because I don't think the difference is too important stylistically.

@SAOPP
Copy link
Author

SAOPP commented Oct 12, 2021

Dope! It's very comfortably! Thanks.

@rianadon
Copy link
Owner

Closing now that this is implemented in v1.14! Thank you for the suggestion!

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

No branches or pull requests

2 participants