rianadon / timer-bar-card

A progress bar display for Home Assistant timers
Other
389 stars 15 forks source link

When changing resolution to minutes, they should be rounded down #154

Open kr0ner opened 3 months ago

kr0ner commented 3 months ago

Describe the bug image

If the resolution is not set, it would display 1:59:59 when set to "minutes", it rounds up to 60 which looks a bit weird

Your card configuration

type: custom:timer-bar-card
entity: switch.esp32_poe_technik_kuehlung_hk1
name: Kühlung HK1
duration:
  fixed: '02:00:00'
invert: true
bar_width: 60%
icon: mdi:snowflake
resolution: minutes
mushroom:
  layout: horizontal
  secondary_info: none
...
rianadon commented 2 months ago

Oh, how odd. The 1:60 should be 2:00.

The rounding up is an intentional choice. I find it weird to have the timer show 0 when there are still a 59 seconds to go, so I round up to 1 minute. To be consistent, every time is rounded up.