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
I've added new card "bar-card" that looks exactly like other cards with slider but slider ignores its interactions, so it's just a bar. Also main feature is that bar can change color from red to green depending entity value. New element basically comes from number-card.
UI editor was added for new card type.
Demo view was added for new card type.
Documentation was added for new card type.
Also I've added translations for parameters and their fixed values, but some of them may be a little clumsy (if so, I hope that people familiar with language will correct this).
Related Issue
This PR fixes or closes issue:
closes #387
closes #692
closes #1181
Motivation and Context
There is no suitable card for convenient display of sensors, batteries, air_quality devices. Many users (including me) want an element like “custom:bar-card”, which is poorly supported and does not fit the style of mushroom.
How Has This Been Tested
I've added this elements to Home assistant demo server, used new card on several elements like sensors, numbers, input_number_ air_quality.
Pass the test with different card parameters: entity, title, icon_color, min, max, enable_color_severity, severity_direction, appearance and actions with lots of combinations. Also I use this card in my own HA instance.
I've tested editor in some supported languages to test translations are applied correctly.
This not affects other elements because it's a separate card.
Types of changes
Checklist