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

Volume_id #101

Closed Chewie610 closed 5 months ago

Chewie610 commented 5 months ago

Is your feature request related to a problem? Please describe. No way to set the entity that the volume buttons would control.

Describe the solution you'd like Create a Volume_id to set the entity that the volume buttons would control. Much like the Slider_id, it'd be useful if the volume buttons generated could be attached to controlling a speaker.

Describe alternatives you've considered Have volume buttons default to use what Slider_id could also work. Or maybe making a unanimous_id such as Volume or Speaker id.

Additional context Add any other context or screenshots about the feature request here.

Nerwyn commented 5 months ago

Global IDs for remote features was something from the project this was forked from, and not something I'm particularly fond of. In the next major version they'll mostly be hidden/deprecated.

Just set custom actions for the volume buttons.

custom_actions:
  volume_up:
    tap_action:
      action: call-service
      service: remote.send_command
      data:
        command: VOLUME_UP
        entity_id: remote.your_id_here
  volume_down:
    tap_action:
      action: call-service
      service: remote.send_command
      data:
        command: VOLUME_DOWN
        entity_id: remote.your_id_here
  volume_mute:
    tap_action:
      action: call-service
      service: remote.send_command
      data:
        command: MUTE
        entity_id: remote.your_id_here
Chewie610 commented 5 months ago

Sounds good. In my case, I'm using a speaker so I just use the media player service.

custom_actions:
    volume_up:
        service: media_player.volume_up
        target:
          entity_id: media_player.your_id_here

Will you be keeping the slider_id though?

Nerwyn commented 5 months ago

In the next major version you'll be able to create multiple sliders, so it wouldn't make sense to have one overarching slider ID. It'll continue to work for the default slider but be hidden from the UI.