-
-
Notifications
You must be signed in to change notification settings - Fork 37.8k
Add 2 media_player services and 1 custom service to Squeezebox platform #10969
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
cee026c
0d5c5af
45b45ae
266f525
20c8f2f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -281,3 +281,13 @@ kodi_call_method: | |
| method: | ||
| description: Name of the Kodi JSONRPC API method to be called. | ||
| example: 'VideoLibrary.GetRecentlyAddedEpisodes' | ||
|
|
||
| squeezebox_call_method: | ||
| description: 'Call a Squeezebox JSON/RPC API method.' | ||
| fields: | ||
| entity_id: | ||
| description: Name(s) of the Squeexebox entities where to run the API method. | ||
| example: 'media_player.squeezebox_radio' | ||
| method: | ||
| description: Squeezebox JSON/RPC method call, in the form of an array of positional parameters. See 'Command Line Interface' official help page from Logitech for details. | ||
| example: '["playlist", "loadtracks", "track.titlesearch=you''re welcome"]' | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's avoid the more complicated quote escaping example here, and pick an easier title. Knowing how to escape quotes in yaml isn't necessary to understand this service. 😄
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fair enough, I changed the title with last commit! |
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Separate the method arguments out into their own optional field on the schema.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that would be nicer (easier to use), but the API supports hundreds of commands, requiring a different number of parameters.
The parameter p2 of one query can have a completely different meaning as the paramater p2 of another one.
So we can't really name the parameters. We could create param_0, param_1 but... up to how many? Most commands have up to 4 but the count can go up quickly, especially for search commands which accept various criteria.
Extract of the documentation:
Some examples:
info total artists ?Returns the number of artists in the DB. Has to be passed as ['info', 'total', 'artists', '?']
playlist loadalbum <genre> <artist> <album>Puts songs matching the specified genre artist and album criteria on the playlist. Songs previously in the playlist are discarded.
For example: ['playlist', 'loadalbum', 'Rock', 'Abba', '*']
genres <start> <itemsPerResponse> <taggedParameters>This is an example of command accepting tagged parameters. An example would be
['genres', '0', '10', 'search:rock', 'artist_id:5', 'album_id:6', 'year:2003']
This would restrict the search to the genres proposed by artist with ID 5, available on the album with ID 6 and with tracks in year 2003.
As you can see in just 3 examples, parameter p1 can be static strings 'total', 'loadalbum', or a number (index of first result).
I think it is easier for somebody used to the Squeezebox API to just give the array of parameters to the service as is.
Let me know if you have another idea!
If you don't have a squeezebox server running, you can find a copy of the documentation here:
https://github.com/elParaguayo/LMS-CLI-Documentation/blob/master/LMS-CLI.md
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, sorry, that was a confusing comment. I just meant separate this out into two fields.
method, which can just be a required string, andarguments, which is an optional array of any arguments.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK I get it now.
I split the unique
methodfield into two:commandwhich is a mandatory string and will be the first parameter passed to the API. I use the wordcommandto be consistent with the API documentation. I did not use the word 'method' because it would be conflicting with the main API method which is always 'slim.request'parameterswhich is an optional array of extra parameters added to the command.