The versatile custom Swiss Army Knife card for Home Assistant allows you to create your unique visualization using several graphical tools, styling options and animations.
224
stars
19
forks
source link
Support more than 1 entity to be passed to a tool #160
All of the current tools support 1 entity: the entity which its state is based upon. Simple and straightforward. No problems.
However, in some cases:
having more entities makes it possible to hide/unhide a tool, say based on the on/off state of another entity.
an entity with say min/max attributes can't be used currently, but with this extension, it can!
Additional background:
The tool will always base its state on a single entity (the first one in the list in this case), but of course, some extra JavaScript using a derived_entity can make any combination of different states and attributes!
Related Issues (if any)
(Optional): Suggested Solution
An example of the YAML definition could be:
a simple list of indexes, where the first one is the primary entity_index
the animations section gets an extra entity_index if not the default entity_index. So existing animations don't have to change (nonbreaking change!!)
template animations should receive the entity_index as a variable: easy!
in the case of multiple entities, the reuse should be automatically set to true, to make sure that all those animations merge the created styling, instead of resetting the styling for each entity. Or maybe a separate setting, merge or so, as the reuse is meant to preserve styling from the previous/last state...
The Problem To Be Solved
All of the current tools support 1 entity: the entity which its state is based upon. Simple and straightforward. No problems.
However, in some cases:
Additional background:
The tool will always base its state on a single entity (the first one in the list in this case), but of course, some extra JavaScript using a
derived_entity
can make any combination of different states and attributes!Related Issues (if any)
(Optional): Suggested Solution
An example of the YAML definition could be:
entity_index
if not the defaultentity_index
. So existing animations don't have to change (nonbreaking change!!)entity_index
as a variable: easy!reuse
should be automatically set to true, to make sure that all those animations merge the created styling, instead of resetting the styling for each entity. Or maybe a separate setting,merge
or so, as thereuse
is meant to preserve styling from the previous/last state...(Optional): Alternative Solutions