PiotrMachowski / Home-Assistant-Lovelace-Local-Conditional-card

This card can show and hide a specific card on current device while not affecting other windows. It does not require any integration to run.
MIT License
61 stars 6 forks source link

multiple cards toggling not working #5

Closed necmes closed 1 year ago

necmes commented 3 years ago

Hello,

First of all thanks for this awesome card!

I create this issue because i'am unable to toggle 2 entities at once.

my card config:

type: vertical-stack
cards:
  - type: 'custom:local-conditional-card'
    id: player1
    default: show
    card:
      entities:
        - media_player.office
      title: Office
      type: entities
  - type: 'custom:local-conditional-card'
    id: player2
    default: hide
    card:
      entities:
        - media_player.kitchen
      title: Kitchen
      type: entities
  - title: Click test
    type: entities
    entities:
      - action_name: Toggle
        name: toggle 1 and 2
        service: local_conditional_card.toggle
        service_data:
          ids:
            - player1
            - player2
        type: call-service

player Kitchen is toggling but not player Office

if i'll swap player1 and 2 like this:

    entities:
      - action_name: Toggle
        name: toggle 1 and 2
        service: local_conditional_card.toggle
        service_data:
          ids:
            - player2
            - player1
        type: call-service

Same behaviour only the second entity is toggling.

if i swap entities on card list:

cards:
  - type: 'custom:local-conditional-card'
    id: player1
    default: show
    card:
      entities:
        - media_player.kitchen
      title: Office
      type: entities
  - type: 'custom:local-conditional-card'
    id: player2
    default: hide
    card:
      entities:
        - media_player.office
      title: Kitchen
      type: entities

The player Office is now toggling but not the player Kitchen

It's like the Toggling function only use the ID of the last defined entity on cards list.

ManCaveMedia commented 2 years ago

Can confirm multiple ids only toggles last id

andiukas commented 2 years ago

the solution is?

TEF2one commented 1 year ago

Sadly seem over a year and still having the same issue...

PiotrMachowski commented 1 year ago

@TEF2one you are right, after 2 years of not being updated this card definitely deserves some love. v2.0.0 coming really soon!

PiotrMachowski commented 1 year ago

Fixed in v2.0.0