sheepster
(sheepster)
April 29, 2020, 5:02pm
1
Hi, I’m using the custom button-card component for activating a scene with this code.
- type: "custom:button-card"
tap_action:
action: call-service
service: scene.turn_on
service_data:
entity_id: scene.normal
show_entity_picture: true
entity_picture: /local/custom_graphics/sun.png
color: auto
The code above works fine,
but I would like to add an indication when the button is pressed.
For example: Changing the background color for 1 second and returning it back to the original color.
Any ideas how i could make it work?
eggman
(bertie basset)
April 29, 2020, 7:29pm
2
I bookmarked this the other day intending to try it out, haven’t yet so I can’t vouch for it
So here’s a little hack for those who want to have feedback on tap (works for hold and double_tap) (cc: @petro ). However, it doesn’t work well if the entity of the card is updated before the animation is finished
tap_action:
action: call-service
always_execute: | # The key can be anything, but not a official documentation value
[[[
this.shadowRoot.getElementById('card').style.background = "COLOR_ON_CLICK";
window.setTi…
1 Like
eggman
(bertie basset)
April 30, 2020, 1:13pm
4
Your thanks should go to @romrider Glad it helped, I’ll probably add it to some places myself at the weekend.