AmoebeLabs / swiss-army-knife-card

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

Closed AmoebeLabs closed 1 year ago

AmoebeLabs commented 2 years ago

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_indexes:
        - entity_index: 1
        - entity_index: 0
        - entity_index: 2
      animations:
        - state: 'on'
          styles:
            circslider:
              fill: red
        - state: 'off'
          styles:
            circslider:
              fill: green
        - state: 'on'
          entity_index: 0
          reuse: true
          styles:
            circslider:
              display: initial
        - state: 'off'
          entity_index: 0
          styles:
            circslider:
              display: none

(Optional): Alternative Solutions

AmoebeLabs commented 1 year ago

Implemented in #187