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.
244 stars 21 forks source link

Wrong Icon is displayed when using multiple entity indexes in animation #210

Closed AmoebeLabs closed 1 year ago

AmoebeLabs commented 1 year ago

Bug report notice

Before you file a bug, make sure that you did not make a configuration mistake. The Swiss Army Knife in its current state does not yet have full configuration sanity checks!

So make sure your problem is not related to that!

Swiss Army Knife version

The version you are using. See HACS or the Browser console v2.4.3

Bug description

A clear and concise description of what the bug is. If more than 1 entity index is used in the animation section, the wrong icon is displayed. In most cases the icon from the secondary entity index.

To Reproduce

Steps to reproduce the behavior:

Below:

A light bulb icon is displayed however!

        - type: 'custom:swiss-army-knife-card'
          entities:
            - entity: light.livingroom_light_duo_right_light
              name: 'CircSlider Test'
              icon: mdi:face-man
            - entity: light.livingroom_light_duo_right_light
              attribute: brightness
              unit: "%"
              format: brightness
              icon: mdi:fan

              - toolset: circ-slider-test
                position:
                  cx: 50
                  cy: 50
                tools:              
                  # ------------------------------------------------------------
                  - type: icon
                    position:
                      cx: 85
                      cy: 50
                      align: center
                      icon_size: 40
                    entity_indexes:
                      - entity_index: 1
                      - entity_index: 0
                    animations:
                      - state: 'on'
                        entity_index: 0
                        reuse: true
                        # icon: mdi:fan
                        styles:
                          icon:
                            fill: 'red'
                          tool:
                            display: initial
                      - state: 'off'
                        reuse: true
                        entity_index: 0
                        styles:
                          icon:
                            fill: 'blue'

Expected behavior

A clear and concise description of what you expected to happen.

A fan icon should be displayed, as configured.

Screenshots

If applicable, add screenshots to help explain your problem.

Desktop browser (please complete the following information):

Companion App on Smartphone/Tablet (please complete the following information):

Additional context Add any other context about the problem here.

(Optional): Suggested Solution

Any suggested solution to this bug.

AmoebeLabs commented 1 year ago

Edge case found during testing, which results in wrong icon display

AmoebeLabs commented 1 year ago

Close