custom-cards / button-card

❇️ Lovelace button-card for home assistant
MIT License
1.93k stars 233 forks source link

Card Properties Open on Tap When using 'state' #643

Open viktak opened 1 year ago

viktak commented 1 year ago

Checklist

Describe the bug If there is no statedefined in the card's definition, tap_action works correclty, i.e. it executes the action, but it does NOT open the entity's property page. When I use the state parameter, instead of executing the tap_action it opens the entity's property page.

Version of the card Version: 3.4.2

To Reproduce This is the configuration I used:

          - type: 'custom:button-card'
            entity: media_player.denon_avr_s660h
            size: 25px
            name: power
            show_name: false
            show_state: false
            color_type: card
            color: 'rgb(45, 79, 140)'
            state:
              - value: 'off'
                icon: 'mdi:power-off'
                tap_action:
                  action: call-service
                  service: denonavr.get_command
                  service_data:
                    entity_id: media_player.denon_avr_S660H
                    command: /goform/formiPhoneAppDirect.xml?PWON
              - operator: default
                icon: 'mdi:power'
                tap_action:
                  action: call-service
                  service: denonavr.get_command
                  service_data:
                    entity_id: media_player.denon_avr_S660H
                    command: /goform/formiPhoneAppDirect.xml?PWSTANDBY

Screenshots If applicable, add screenshots to help explain your problem.

Expected behavior When clicking/tapping on the button, it should execute tap_action regardless if it has state defined.

Desktop (please complete the following information):

Smartphone (please complete the following information):

Additional context