usernein / tv-card

📺 TV Remote Card (with touchpad and haptic feedback)
Apache License 2.0
107 stars 26 forks source link

Add a toggle to swap between controlling a "media_player" and "remote" #9

Open DenyThis opened 2 years ago

DenyThis commented 2 years ago

Hi Cezar!

First of all - great job on this cool TV remote card! Main thing I loved was the ability to swap control rows as desired :)

One feature I think would benefit this a lot (specially for Roku users that rely on using remote instead of media_player based controls) is to have a quick toggle that switches the default behavior of the card. I know that this can be accomplished with custom_keys, but it would be nice to have this out of the box. Another option could be to specify the remote entity that controls said media_player.

This is an example of my current card config, and as you can see it's a bit complex since I need to reprogram every key:

type: custom:tv-card
entity: media_player.living_room_tv
title: Living Room TV
power_row:
  - power
channel_row:
  - return
  - info
  - home
volume_row: buttons
navigation_row: buttons
media_control_row:
  - rewind
  - play_pause
  - fast_forward
apps_row:
  - playstation
  - xbox
  - hulu
source_row:
  - netflix
  - prime_video
  - disney_plus
custom_sources:
  playstation:
    icon: mdi:sony-playstation
    source: PlayStation 5
  xbox:
    icon: mdi:microsoft-xbox
    source: Xbox
  hulu:
    icon: mdi:hulu
    source: Hulu
  disney_plus:
    icon: phu:disney-plus
    source: Disney Plus
  prime_video:
    icon: phu:prime-video
    source: Prime Video
  apple_tv:
    icon: phu:apple-tv
    source: Apple TV
custom_keys:
  power:
    icon: mdi:power
    service: remote.send_command
    service_data:
      entity_id: remote.living_room_tv
      command: power
  return:
    icon: mdi:arrow-left
    service: remote.send_command
    service_data:
      entity_id: remote.living_room_tv
      command: back
  info:
    icon: mdi:asterisk
    service: remote.send_command
    service_data:
      entity_id: remote.living_room_tv
      command: info
  home:
    icon: mdi:home
    service: remote.send_command
    service_data:
      entity_id: remote.living_room_tv
      command: home
  volume_up:
    icon: mdi:volume-plus
    service: remote.send_command
    service_data:
      entity_id: remote.living_room_tv
      command: volume_up
  volume_down:
    icon: mdi:volume-minus
    service: remote.send_command
    service_data:
      entity_id: remote.living_room_tv
      command: volume_down
  volume_mute:
    icon: mdi:volume-mute
    service: remote.send_command
    service_data:
      entity_id: remote.living_room_tv
      command: volume_mute
  up:
    icon: mdi:chevron-up
    service: remote.send_command
    service_data:
      entity_id: remote.living_room_tv
      command: up
  down:
    icon: mdi:chevron-down
    service: remote.send_command
    service_data:
      entity_id: remote.living_room_tv
      command: down
  left:
    icon: mdi:chevron-left
    service: remote.send_command
    service_data:
      entity_id: remote.living_room_tv
      command: left
  right:
    icon: mdi:chevron-right
    service: remote.send_command
    service_data:
      entity_id: remote.living_room_tv
      command: right
  enter:
    icon: mdi:circle
    service: remote.send_command
    service_data:
      entity_id: remote.living_room_tv
      command: select
  rewind:
    icon: mdi:rewind
    service: remote.send_command
    service_data:
      entity_id: remote.living_room_tv
      command: reverse
  fast_forward:
    icon: mdi:fast-forward
    service: remote.send_command
    service_data:
      entity_id: remote.living_room_tv
      command: forward
  play_pause:
    icon: mdi:play-pause
    service: remote.send_command
    service_data:
      entity_id: remote.living_room_tv
      command: play
mdb17 commented 2 years ago

I would second this