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

Delay setting #46

Closed
yazz007 opened this issue Nov 16, 2022 · 9 comments
Closed

Delay setting #46

yazz007 opened this issue Nov 16, 2022 · 9 comments
Labels
feature request New feature or request

Comments

@yazz007
Copy link

yazz007 commented Nov 16, 2022

Hello,
I'm missing Delay feature, which would be great to avoid unnecessary entity changes. For example, I have to change hour and then minutes, every time I click the entity changes. I'm using also numberbox-card and the feature is there and plays really nice.

@yazz007 yazz007 added the feature request New feature or request label Nov 16, 2022
@GeorgeSG
Copy link
Owner

GeorgeSG commented Nov 16, 2022

Hi!

I'm not sure I understand the problem you are describing. What problems do you have when changing hour and them minutes?

When are unnecessary entity changes happening and why is this bad?

Please try to describe this more in terms of what is the current problem you are facing instead of what is a potential solution. Thanks!

@yazz007
Copy link
Author

yazz007 commented Nov 17, 2022

Hi,
Example, time set to 20:00, basic setup so hours and minutes separately (minutes_step 5).

I want to set to 20:35, so clicked 7 times, in that time, the entity changes 7 times and trigger 7 times any automation based on it. I'm using Appdaemon and I listen to changes for that entity, I don't want 7 different times, like 20:05, 20:10, 20:15, 20:20, 20:25, 20:30 and 20:35. I'm interested in the final time - the 20:35.

My application is working with that but with quite lot of workaround ;-)

It could be much simpler if time-picker delays (like number-box) for few seconds till the timer reaches expected time.

Thanks for understanding :)

@GeorgeSG
Copy link
Owner

@yazz007,

Thanks for the suggestion!

I just implemented this as an optional property in version 1.4.0. Let me know if you have any issues.

@Protoncek
Copy link

Protoncek commented Nov 20, 2022

Hi, George!
First, thanks for very usefull card!
I'm not sure that this works as it should (or as yazz007 wanted)...
first: for times up to 255 it works ok, above that it doesn't change at all (is it this variable "byte" and allows only 0 to 255 ms?)
Second...when i click on "up" number on screen updates only after delay - so if i would set delay to, say 2 seconds then setting would be pretty annoying, since i'd have to wait 2s for each click.
A better solution (if possible) would be something in style of "simple thermostat card": https://github.com/nervetattoo/simple-thermostat - here i click on arrows for temp.change and number becomes red, which means entit is not yet updated, but after appr.1s it becomes white, which means entity is updated.

@GeorgeSG
Copy link
Owner

GeorgeSG commented Nov 20, 2022

HI @Protoncek,

I have tested this with values over 1000 and it works fine in my test environment. You can test for yourself if you want - see the devtools folder in this repo. I am using the standard setTimeout API.

since i'd have to wait 2s for each click.

You don't have to wait. Updates are queued, so if you click multiple times, all the clicks will register at once, after the specified delay time (so in your example - 2s).

click on arrows for temp.change and number becomes red, which means entit is not yet updated[...]

I agree this is a better solution, but I mostly added this as a workaround for people who need this. If someone is willing to work on this, I'd be happy to look at a PR.

Thanks for your feedback!

@Protoncek
Copy link

Interesting... this code doesn't work here:

type: custom:time-picker-card
entity: input_datetime.cas_gretja_pavle_zjutraj_delovnik
hour_mode: 24
hour_step: 1
minute_step: 1
second_step: 5
delay: 1000
name: Čas gretja zjutraj delovniki
hide:
  name: false
  icon: true
  seconds: true
link_values: true
layout:
  embedded: true
  align_controls: right
  hour_mode: single

Did i perhaps insert delay wrong? I can click indefinitely, but numbers doesn't change with values over 251 (251 works, 252 not anymore).

I don't need this at this moment, so if i'm only one with this fault then it's not a big deal...

@GeorgeSG
Copy link
Owner

@Protoncek I am unable to reproduce the issue with your exact config.

There may be something else in your environment that affects the entity or the UI.
2022-11-20 18 44 02

@Protoncek
Copy link

Very interesting... i guess i'll have to play a bit with my HA then... god knows what's wrong....
Thanks!

@yazz007
Copy link
Author

yazz007 commented Nov 21, 2022

Hi @GeorgeSG
thank you for your effort :)

It does work for me, but to be honest, it feels strange - I can't see feedback - actually need counting to change.
Numberbox-card behave like this:
numberbox-card
The changes of time should be visible but the entity updated after delay.

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

No branches or pull requests

3 participants