Clooos / Bubble-Card

Bubble Card is a minimalist card collection for Home Assistant with a nice pop-up touch.
MIT License
1.45k stars 39 forks source link

Haptic feedback events firing multiple times or not at all #616

Open arthanoss opened 3 days ago

arthanoss commented 3 days ago

Tapping on buttons or sub buttons makes haptic events fire multiple times. The forwardHaptic function gets called two or three times depending on the button type (on icons it seems fine). It's really noticeable on my Android device through the companion app, can feel each vibration separately. For some reason it feels fine when HA is opened through Chrome (single vibration on tap), but the issue is still there.

Another issue is when there's no haptic feedback at all. Seems kinda random, but there's one example scenario where it's pretty consistent:

- type: custom:bubble-card
  card_type: button
  button_type: name
  name: Open popup
  button_action:
    tap_action:
      action: navigate
      navigation_path: '#testpopup'
- type: vertical-stack
  cards:
    - type: custom:bubble-card
      card_type: pop-up
      hash: '#testpopup'
      button_type: name
      name: Test
  1. Tap on a button - vibration.
  2. Close popup with the X button.
  3. Tap on a button again - no vibration.

If between steps 2 and 3 I tap somewhere else, then it works.

Also, when clicked on a desktop in the same scenario (or even through DevTools connected to the same Android device), the aformentioned forwardHaptic function gets called every time. It's only with touch events directly on the phone it sometimes doesn't. Dunno, I haven't dug deeper into this. Hope that helps somehow 😅

Tested on the latest versions of HA and Bubble Card.

As a side note. There's an option in the Android companion app settings that allows to disable vibrations. Bubble Card seems to ignore that setting. Not sure if it's even possible to use that, but maybe even better would be a YAML option to disable vibrations per action.

Thanks for your great work. Love these cards! ❤️

Clooos commented 3 days ago

Hi, that issue is already fixed in v2.1.0-beta.1.

https://github.com/Clooos/Bubble-Card/releases/tag/v2.1.0-beta.1

arthanoss commented 2 days ago

I'm already on that beta. It was a different issue, where it could vibrate for even a few seconds before making an action. That's fixed indeed, but the one I described above is still there.

Clooos commented 2 days ago

Thank you for the details, I will take a look at this then! Ho and next time you open an issue please provide the requested informations like the version, some users don't update to the betas.