Closed drobtravels closed 6 months ago
I did figure out the right formatting to call time.set_value
with the following template:
{{ (120|int*60)|timestamp_custom('%H:%M', false) }}
BTW, I'm happy to make a PR but wanted to check in for guidance first since this would be a major change.
Hi,
I have made a start on this and have a working version, trying to add an experimental option at the moment to enable / disable "untested" features (#76 #83).
Just been busy with work lately.
New update to be released soon:
Checklist
Is your feature request related to a problem? Please describe.
First of all, thanks so much for making this integration! It's been useful.
I find the time entities clunky to interact with in the UI and confusing to set. For example the UI displays 12:00am for 0, and 2:00am for 2 hours.
It is also difficult to automate changes via the
time.set_value
service, since I believe this requires requires theHH:MM
format.Describe the solution you'd like
I propose
number
entities with the duration of time limit in minutes and bonus time.This would allow sliders in the UI to slide from 0 to 120 minutes, and in my opinion, be more intuitive to interact. It would also simplify automations without complex templating.
I understand this would be a breaking change however.
Describe alternatives you've considered
I have started creating
input_number
helpers for the UI with automations to calltime.set_value
when changed, and updateinput_number
when time changes.I'm struggling to convert minutes to the correct format in a template, however. For example 120 minutes would require a time value of
2:00
or02:00
.Additional context
Thanks so much