Lovelace: Button card

Dear, I found a problem
Don’t know if anybody else is facing,
I have an entity as button card which on hold_action was working well.
But after upgrading button-card few days back, it was toggling on single tap.

It’s not clear what your actual problem is. You refer to a hold action working well but then start talking about toggling with a tap…what’s the actual problem?

Dear
Hold_action was not working on holding the button.
It was toggling even on single tap.
I had to add tap_action: none before hold_action to get it working.

Toggle is by default for tap, unless you define tap_action’s action as none. That’s not new at all.

Okay, thanks for all the testing, appreciate it!
This bug was probably introduced by those 2 lines which where added to fix another bug:

Would you mind deleting them from 2.0.4 and test the result on your device please?

I actually tried that already and didn’t have any luck. It is also in the button-card.ts so I just tried removing it there also and I still have it happen unfortunately.

That is really strange… It’s the only thing which was changed regarding touch/mouse events…

Also for this to work, you’d have had to remove the node_module folder and run npm install :wink:

Could you try that file please? https://www.pastiebin.com/5d3fec8d63daf

EDIT: I’ve managed to reproduce the “second clic on the target tab” when moving from one tab to another tab on my phone (android) and it’s fixed with the above version for me.

1 Like

I think this fixed it!

It looks like the button card doesn’t like the swiping. I can swipe the views on the “empty” area (button card color type: blank) only my Lovelace dashboard:

Thanks, that’s going to be fixed soon. I’ll release something tomorrow.
It’s all related to this and this

1 Like

I appreciate all the work with resolving this and the great card itself.

I have the same problem but in android, the lock option does not work, the entity is activated with a single click, I was going to communicate it here the other day but in the end I deleted the post thinking that the problem would be mine for any reason, I deleted cache and It does not work, however on the PC everything is correct. Thank you for the support of the creator.

hello, in my case if I change the tab and return to the first one, at the first click the lock option works well but the next time it activates the entity again with a single click, I am with android I guess the problem will be the same as that of the companions with ios and you can sloucionar it in the next update, greetings and thanks

I must admit to having lost track a bit with state of play with this, I kinda switched off when it looked like an IoS problem :stuck_out_tongue_winking_eye: but I also get this on Android.

As I said I’ve lost track so if it is in the process of being fixed ignore me, and if it isn’t, I’m not complaining, just adding some info.

Feel free to open github issues/look at the github issues when you encounter problems.

It’s also easier for me to track them over there than over here :wink:

Hello.
I have button with tap action to switch sonoff relay on/off
But is any method to add on hold button more-info from other entity?
Tap change relay but i need more-info from tradfri bulb. Color and brightness sliders.

hold_action:
  action: more-info
  entity: your_other.entity

Done, but it’s not a big problem for me.

thanks for open it,for me lock option its essential.