Mini-media-player: Service as an shortcut item option type?

Created on 18 May 2019  路  5Comments  路  Source: kalkih/mini-media-player

I have been trying to find out if your card can use services (with service data) for a shortcut button.
Is it possible, if not, any change it will be implemented?

image

Here is my code for a custom button card:
" ....
tap_action:
action: service
service: media_player.rotel_send_command
service_data:
command_name: TREBLE_UP
entity_id: media_player.rotel_rsp_1570
type: 'custom:button-card'
"

enhancement help wanted

Most helpful comment

I would just like to say thank you for this, and other awesome options in this solution :-D That's all!

All 5 comments

No, service is not accepted as type.
As for data:

1 Only compatible with script shortcuts, useful for sending variables to script.

I don't think support for service will be added, sorry, I want to keep the shortcut functionality really simple, I recommend using the custom button card for more advanced uses, could always wrap it together with the media player inside a vertical-stack-in-card.
You could also create a script which calls desired service by either provided variables or hard coded.

But never say never, could potentially be added, I guess it wouldn't require much extra code and should be pretty simple to implement if we reuse the id option as [domain].[service].

If anyone else is interested in this, A PR would be much appreciated.

"Pull requests let you tell others about changes you've pushed to a branch in a repository on GitHub."

I dont have the know-how to make changes to your card code unforttunatly : (
But please have this in mind for future functionality : D

Now possible with the latest release

I would just like to say thank you for this, and other awesome options in this solution :-D That's all!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

cweakland picture cweakland  路  6Comments

kbrohkahn picture kbrohkahn  路  3Comments

gerard33 picture gerard33  路  3Comments

jjlawren picture jjlawren  路  4Comments

rpitera picture rpitera  路  3Comments