Skip to content

3.4.0 - Momentary Buttons, Customizable Timings, and Fire TV Keyboard

Compare
Choose a tag to compare
@Nerwyn Nerwyn released this 26 Feb 00:36
· 142 commits to main since this release

Momentary Buttons #58

This release adds an alternate button operating mode, momentary buttons. While disabled by default for all buttons and the touchpad, it can be enabled by creating custom actions for any button or the touchpad center action using action types momentary_start_action and momentary_end_action.

momentary_start_action fires when the button is initially pressed down and momentary_end_action fires when the button is released. Configuring either of these and setting their action fields to anything except none (or if their templates resolve do not resolve to none) will disable the buttons tap, hold, and double tap actions completely.

You can use momentary button mode to include HOLD_SECS in the momentary_end_action service call data

custom_actions:
  momentary_light:
    icon: mdi:ceiling-light
    momentary_start_action:
      action: call-service
      service: light.turn_on
      data:
        entity_id: light.sunroom_ceiling
    momentary_end_action:
      action: call-service
      service: light.turn_off
      data:
        entity_id: light.sunroom_ceiling
  fast_forward:
    momentary_start_action:
      action: none
    momentary_end_action:
      action: call-service
      service: remote.send_command
      data:
        entity_id: remote.google_tv
        command: MEDIA_FAST_FORWARD
        hold_secs: HOLD_SECS

Customizable Timings #60

You can now customize the delay between repeats for repeated hold actions using repeat_delay (default 100ms), the amount of time you have to trigger a double tap action using double_tap_window (default 200ms), and the amount of time you need to hold down a button to trigger a hold action using hold_time (default 500ms).

Note: setting double_tap_window larger than (or too close to) hold_time may result in undesirable behavior. Make sure to adjust both accordingly! Also, increasing double_tap_window will delay single tap actions even further.

All three of these values can be set either globally in the config root, or for specific custom actions like so.

repeat_delay: 200
double_tap_window: 500
hold_time: 1000
custom_actions:
  volume_up:
    hold_action:
      action: repeat
      repeat_delay: 50
  center:
    double_tap_action:
      action: key
      key: BACK
      double_tap_window: 300
    hold_action:
      action: key
      key: MENU
      hold_time: 600

Fire TV Keyboard Mode #62

While Fire TV is a fork of Android (until Amazon switches to their own proprietary OS in the future) and works with the current Android TV ADB keyboard for alphanumeric keys, it does not work with the backspace, delete, and enter keys as they are currently being sent with the Android Remote TV API, which Fire TV does not support. You can now set keyboard_mode to FIRE TV to fix support for these keys and send them via ADB instead.

Other Changes

  • Fix some overlooked auto field setting code for multi actions.
  • Fix empty buttons not generating correctly.
  • Change touchpad and slider background colors to --primary-background-color, as the previous --secondary-background-color color gets overwritten by Home Assistant to the default theme value if set to a different color in a custom theme.
    • Not sure if this was a recent change in Home Assistant, and if it's a bug or desired behavior.

Full Changelog: 3.3.0...3.4.0