Replies: 3 comments 7 replies
-
Yes, as per release notes, these action hacks are no longer supported, but a new So your config should be: type: custom:button-card
name: Watch TV
icon: mdi:television
show_name: true
show_icon: true
tap_action:
action: javascript
javascript: |
[[[
hass.callService(
"script",
"watch_tv",
{}
)
window.history.pushState(null,"","/tablet-main/remote-view");
window.dispatchEvent(new CustomEvent("location-changed"));
]]] |
Beta Was this translation helpful? Give feedback.
-
just getting into these javascript commands since now officially supported.. tha final 2 window lines are a mystery to me yet, so need to learn more about those too... I suppose it next navigates to /remote-view? not sure about the last line, or is that just to signal the frontend the location was changed? edit need to find one that can play a local sound blib upon clicking....a bit like haptic, but then make a sound btw, we can now do this all in regular config lingo:
|
Beta Was this translation helpful? Give feedback.
-
thinking of this, @dcapslock @RomRider , wouldnt it be cool if button-card got a
of course with template support (eg to catch frontend interaction...) |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello all! I've been using the button-card for a while and have done some pretty interesting things with it, and it's been a staple of my completely custom home-theater mode, thus far. It's been working flawlessly up until the latest update of the button card and I'm curious if the functionality underlying has changed and I need to adapt my dashboards to it, or if this could be a bug:
I have several buttons defined similarly to this example:
and, as mentioned, has been working perfectly for several months. The script has NOT changed and runs successfully if I launch it via the "scripts" view, nor has the view/button definition; with nothing erroneous being sent to the logs. However, since the last update of the button-card via HACS, every button using the button-card has stopped working.
Any idea how to fix this? Or, more importantly, could this be a bug in the latest push?
Beta Was this translation helpful? Give feedback.
All reactions