Yeah. Unfortunately with the method used it is using the long press defined in HA core. So if you don’t have an element that supports long-press in your view, it won’t work
@RomRider we should probably make a note this or have a fallback for when long press cannot be found. Once we implement roll-up, we should be able to have our own hold implementation.
@petro I added an anchor for styles just yesterday! But, what is the scope for anchors? That is, if I define them in a block early in the ui-lovelace will they be available to all areas below, including into !include files? Or, are anchor scopes perhaps limited somehow?
Starting to integrate the new hold_action into my UI and wanted to share a quick demo GIF to maybe give people an interesting idea: https://gfycat.com/orangeminiatureblacklemur
I have a “Daily Stats” and “Weekly Stats” that are integrated into the same button now thanks to hold_action. Default is daily view and if you long press it swaps it out to a weekly view. Also shoutout to @iantrichLovelace Text Divider Row.
On the right side is imo a cool usage of both state and animation (blink). When I press the Printer button it shows a conditional card underneath with all my printer stats, but the cool thing is how the icon changes to a big green blinking arrow pointing down so it’s obvious what happened and where to look. When @RomRider awesome looking WIP layout PR gets merged that printer settings button should look nicer too
@RomRider I have some issues with the tap_action. In the cases (one example below) I replaced the single line “action: more_info” with the two lines below (according to examples in Github) the more_info does not show. (cleared cache etc)
Sorry @Tyfoon, examples in the documentation are not completely up to date more_info is deprecated, you should use more-info
We’re going to fix the documentation soon.
@RomRider you are amazingly fast. Have been waiting for someone to implement the hold_action for months (I am not a programmer or I would have done it myself haha).
I will definitely try the card again now, but need to find the time to rewrite everything. Amazing job and thank you.
Any errors in the browser console? I would venture a guess that you are having errors on not having longpress defined. Try placing a regular entity-button on the view as well
Add an entity-button in your view and long press will work. It’s a caveat of the current implementation. We’ll work on this in the future with @iantrich to not rely on home-assistant’s implementation.