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

new format option: elapsed #89

Closed
wants to merge 1 commit into from
Closed

new format option: elapsed #89

wants to merge 1 commit into from

Conversation

ktownsend-personal
Copy link

This solves a case where I have a value in seconds but need HH:MM displayed. The specific case is time_remaining attribute on a sprinkler zone.

I was going to revise the readme.md too, but for some reason GitHub keeps blanking the entire view when I try to edit it. I guess you'll have to update that if you merge my change.

This solves a case where I have a value in seconds but need HH:MM displayed. The specific case is time_remaining attribute on a sprinkler zone.
@benct benct added the enhancement New feature or request label Sep 10, 2020
@benct
Copy link
Owner

benct commented Sep 10, 2020

Looks good 👍 I'll try to merge this in when I get the time to bump a new version.

benct added a commit that referenced this pull request Oct 9, 2020
@benct
Copy link
Owner

benct commented Oct 9, 2020

I ended up with implementing this slightly differently, using the same seconds-to-duration calculation and format as the HA frontend. Also, the option is now called duration, as it can both represent time elapsed or remaining. I have not tested this properly, so it would be great if you could let me know if it is not working as expected (v3.4.0).

Thanks for your contribution!

@benct benct closed this Oct 9, 2020
@ktownsend-personal
Copy link
Author

Thanks! I checked the latest version with "duration" and it appears to be working correctly. I didn't know about the secondsToDuration() method. That's much simpler than what I had.

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

Successfully merging this pull request may close these issues.

2 participants