piitaya / lovelace-mushroom

Build a beautiful Home Assistant dashboard easily
Apache License 2.0
3.57k stars 332 forks source link

[Feature]: Display countdown time for timer entities instead of status #684

Open SGXander opened 2 years ago

SGXander commented 2 years ago

Is your feature request related to a problem?

Not related to a problem

Describe the solution you'd like

For the entity card and entity chip can timer entities display the countdown as they do when in a normal entity card please.

Describe alternatives you've considered

templating the calculation produces a countdown that only updates once a minute and is suboptimal when compared with the default entity card

Additional context

the template chip could also use this although I am not sure how it could be implemented

Tamago2000 commented 1 year ago

Another one with the same issue!!!

RickeyWard commented 1 year ago

I have implemented this as a separate countdown card instead of hijacking the built in entity card (since this seems to be how must of the cards are done, instead of adding options to existing cards just add another card)

@piitaya I'm very happy to create a pull request if this is something that the maintainers might accept, I've seen PRs say that they should have been discussions before prs

mushroom-countdown-card Just renders the entity state as a countdown (hours minutes seconds) hiding empty values as long as the state domain is timestamp. Otherwise behaves likes an entity card.

comparison

https://github.com/RickeyWard/lovelace-mushroom/tree/feature-countdown-timer-card

RickeyWard commented 1 year ago

Working with maintainers on how to get this feature included, they don't like the idea of making it its own card but they haven't gotten back to me if they want additional options for base entity card.

In the meantime I created an addon build that adds the features for anyone that wants it.

Mushroom-countdown-card gist