Nerwyn / android-tv-card

A completely customizable universal remote card for Home Assistant. Supports multiple platforms out of the box.
Apache License 2.0
254 stars 13 forks source link

Add option for how many times hold action is repeated per second #60

Closed Simsala91 closed 9 months ago

Simsala91 commented 9 months ago

Currently, when you hold a button or the touchpad, it will repeat the action 10x per second. Personally, I think this is too much. But this mostly comes down to personal preference.

Describe the solution you'd like Add an option that changes how often a button is repeated per second. This could be an optional config for the card, for example:

type: custom:android-tv-card
remote_id: remote.google_chromecast
slider_id: media_player.google_chromecast
keyboard_id: media_player.google_chromecast_adb
hold_actions_per_second: 5   #default 10
...
Nerwyn commented 9 months ago

Good idea, but it would make more sense to let users redefine the delay rather than the frequency. So something like repeat_delay with a default value of 100 (ms). I should also try to make this configurable for either all repeats or at a custom action level.

Nerwyn commented 9 months ago

Implemented in 3.4.0, which is still in alpha as I implement other feature requests. repeat_delay can be set in either the root of the config or in custom actions as follows:


repeat_delay: 500
custom_actions:
  volume_up:
    hold_action:
      action: repeat
      repeat_delay: 10
  volume_down:
    hold_action:
      action: repeat
      repeat_delay: 10
Nerwyn commented 9 months ago

Ready to for testing and feedback in 3.4.0-beta.001!

Simsala91 commented 9 months ago

Tested both global setting and global setting + individual setting for action and looks very good , everything responding as expected 👍 Thank you! :)

Nerwyn commented 9 months ago

Added in 3.4.0