custom-cards / button-card

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

external button tap_action with confirmation option #806

Closed snakedm closed 7 months ago

snakedm commented 7 months ago

Checklist

Describe the bug If I add confirmation option, the call-service button.press don´t work anymore.

Version of the card Version: last

To Reproduce This is the configuration I used:

type: custom:button-card
entity: sensor.dreamebot_d10s_plus_filter_time_left
name: Filtro
confirmation:
  text: >-
    Pretende mesmo fazer reset ao contador?  Confirme apenas se
    efetuou mesmo a limpeza do filtro!
tap_action:
  service: button.press
  data: {}
  target:
    entity_id: button.dreamebot_d10s_plus_reset_filter

Desktop (please complete the following information):

Additional context Without confirmation, the button service works. And conformation without button also works. Together dont work...

snakedm commented 7 months ago

Solved! Only missing action: call-service

correct code:

type: custom:button-card
entity: sensor.dreamebot_d10s_plus_filter_time_left
name: Filtro
confirmation:
  text: >-
    Pretende mesmo fazer reset ao contador?  Confirme apenas se
    efetuou mesmo a limpeza do filtro!
tap_action:
  action: call-service
  service: button.press
  data: {}
  target:
    entity_id: button.dreamebot_d10s_plus_reset_filter