-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Improve duration formatting #23025
Improve duration formatting #23025
Conversation
Ok great! I didn’t realise that would work. These examples come from ESPHome projects I’ve built myself; they are configured as durations in seconds in ESPHome config. But your method works nicely, so thanks |
Good day Can we please get this reverted. The unit of measure is what the base value is provided in. For activity sensors where the duration can range between seconds to minutes to hours to days for the same entity value, you cannot hard set the unit of measure. The dynamic formatting which handled these scenarios was very beneficial in these cases. A different approach is required here please. Thank you Bug ref #23338 |
Good day @piitaya, @bramkragten After further discussion on #23338 would it be possible to by default use the previous functionality that automatically formatted the value in a human readable way. Also the unit of measure selection field is not showing for me to select on the latest version. Thank you |
I'm seeing some issues with the new formatting in an integration that previously worked fine with activity lengths being shown in hours, minutes and seconds..whereas now it just shows in seconds. Please see my further info from my previously logged bug below Since 2024.12, the time duration seems to have changed to only seconds...and it no longer appears to be possible to change this after a core change, so its no longer possible to show duration in hours, minutes and seconds For clarity, no further core updates have reverted this issue and from this thread it appears this has been done by design |
Proposed change
format_duration.ts
andduration.ts
filesEntity card example
Partial fix for #21346 (graph tooltip is not part of this PR as it requires more work)
Partial fix for #20533 (time default formatting is not part of this PR)
Type of change
Example configuration
Additional information
Checklist
If user exposed functionality or configuration variables are added/changed: