Mini-media-player: Feature request: extend button functionality

Created on 8 Feb 2019  路  3Comments  路  Source: kalkih/mini-media-player

The latest version of the mini media player is awesome (as was the previous one :wink: ).

I am currently using the buttons (as part of the shortcuts) for my TV.

I really would like to extend the use of these buttons. Would it be possible to also call scripts and/or services with these buttons?
Then I can add a Netflix button to my Nvidia Shield media player which is integrated in the card :grin:

Currently I am using custom button card to achieve this. But that's not that nice as it is a separate button and I have to add it in a conditional card to hide the buttons when the Shield is off.

- type: custom:button-card
  icon: mdi:netflix
  color: 'var(--accent-color)'
  size: 20%
  style:
    - font-weight: bold
    - color: 'var(--primary-text-color)'
  action: service
  service:
    domain: media_player
    action: androidtv_intent
    data:
      entity_id: media_player.shield_tv
      intent: '-n com.netflix.ninja/.MainActivity'
enhancement

Most helpful comment

Thanks @gerard33, I appreciate it!
Great suggestion, I'd prefer to not add more complexity to the card, but adding support for triggering scripts should be simple and would work with the current option syntax as well (no breaking changes required).

Let me think about service calls for a bit, but scripts for sure!

All 3 comments

Thanks @gerard33, I appreciate it!
Great suggestion, I'd prefer to not add more complexity to the card, but adding support for triggering scripts should be simple and would work with the current option syntax as well (no breaking changes required).

Let me think about service calls for a bit, but scripts for sure!

Triggering scripts through shortcuts is now available in the latest release.

# Example button to trigger script
- type: custom:mini-media-player
  entity: media_player.example
  shortcuts:
    buttons:
      - name: Channel 4
        id: script.change_channel
        type: script

Thanks! This works really great :+1:

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Tom-ahawk picture Tom-ahawk  路  5Comments

TheRealBadRobot picture TheRealBadRobot  路  3Comments

kbrohkahn picture kbrohkahn  路  3Comments

jjlawren picture jjlawren  路  4Comments

fleXible picture fleXible  路  5Comments