Feature countdown-card for timers #1099
Open
+472
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Adds a new card that when showing state with the device_class of 'timestamp' will show a countdown refreshed client-side instead of the ha-relative-time component (uses a shared new mushroom-time-countdown which is just a lit element that handles date objects into countdown timers). It's mostly a copy of entity component with the change that it interprets timestamps as countdown targets instead of relative time targets.
when the entity is available but isUnknown the state string can be overridden with
unknown_message
, and when the timer is elapsed, the elapsed message can be overridden withtimeup_message
.the timer follows the state, so if the primary is set to state it will be the timer countdown, same for default of secondary. all the usual mushroom config follows the entity card.
Related Issue
This PR fixes or closes issue: closes #684 and discussion #723
Motivation and Context
The rationale behind making it a new card type and not having some kind of flag on entity is 2 fold. Firstly, simplicity, no need to make the entity card more complex for niche use-case. Secondly, its desired to have override text for the new states that arise when a) timer's tend to be in the unknown state and its not a pretty message. b) the message when the timer is up should be customizable beyond just language.
Its is also desired by others in the issues tracker.
How Has This Been Tested
Running in my home assistant instance, works on windows 11 in chrome latest, iOS 15 on iPhone 11;
verified all the states work.
Types of changes
Checklist