timer-bar-card icon indicating copy to clipboard operation
timer-bar-card copied to clipboard

`resolution: automatic` showing 60mins instead of an additional hour

Open JCPvanHooren opened this issue 1 year ago • 2 comments

First: thank you for this card; it's a very nice card!

Bug Description When selecting resolution: automatic, the remaining time is nicely truncated to show hours and minutes, but no seconds, when there's more than 1 hour remaining. Unfortunately, it rounds the minuntes up, even when there's X:59:SS left, meaning it'll show X hours and 60 minutes.

Card configuration (nothing exciting)

type: custom:timer-bar-card
entities:
  - timer.a_c
invert: true
layout: full_row
resolution: automatic

Debug information I haven't included this, as the card is function fine, just showing an odd number in the GUI. If you do want me to include, please let me know.

I guess the solution could be to round the minutes down, instead of up, which would avoid a more complicated logic to add another hour. If this is undesirable, of course it could be done to add an hour when the minutes would be 60.

JCPvanHooren avatar May 29 '24 16:05 JCPvanHooren

Good find! We agreed in #86 to round the minutes up, so I'll go with the more complex logic of making 1:59:59 seconds round to 2:00 minutes.

rianadon avatar Jun 02 '24 20:06 rianadon

Same goes for format: hm While strictly not incorrect, 3:60 looks silly.

xoferz avatar Nov 26 '24 18:11 xoferz