-
Notifications
You must be signed in to change notification settings - Fork 38
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
CLI Documentation Questions #52
Comments
Thanks for looking into all this, @Daksol! Alas, it can be overwhelming... It would be easier to follow up if you had one question per issue, or if you posted one question per thread in the forums. Here you have at least two totally independent questions, with a lot of information... So in short: the As for the
|
OK thanks, will ensure one question per comment. Let me restate the issue with the
|
I have a Python script which runs the whole thing, can share that if useful. Meantime here is the CURL version, should work once you have correct IP and port STEP 2 - Run this command to get the current players and their mac addresses
STEP 3 - Take the mac addresses of first three players and put them into the code below. There are two commands (as per my syntax-2, syntax-4 from above) for each player, If for the second and subsequent players you see different responses from the two syntax commands - then problem demonstrated. STEP 3-0: playerindex=0, 98:2c:bc:18:e1:06
STEP 3-1: Playerindex=1, 00:04:20:28:c7:f1
STEP 3-2: Playerindex=2, 00:04:20:12:ae:f5
|
You should look at the code where those functions are registered. The decision to have |
@Daksol I just learned that the |
I'd be happy to help add the |
@michaelherger I have looked again at the original HTML source, and can see the error I made. I clearly not careful enough when looking at the section starting with "Plugins" - because there are other sections (Favorites, RandomPlay, MusicIP ??) which may not really have been part of "Plugins". The unmigrated sections are as follows, in the order in which they appear...
Could I ask @michaelherger to review this list and confirm which sections still need to be migrated? With that clear, happy to work with @edgar-vincent to see work to completion. Thanks. |
I'd say only migrate those labeled Still to be Migrated. All of the rest can be considered obsolete. Thanks! |
@michaelherger I have done some quick tests to confirm that I can make these other commands work properly - via a Python script which submits the commands into the JSONRPC processor. Observations/Questions arising from that testing (may need some help with musicip, see below) Favorites
Randomplay
MusicIP
|
The Favorites plugin is "enforced": you can't disable it, as it's too deeply integrated in to the core of LMS. "can" seems to be buggy, but I wouldn't care too much either. Just don't tell anyone 😂. Random Mix requires the plugin. MusicIP not only requires the plugin itself, but also a working MusicIP application setup. If the plugin can't find the application, it wouldn't initialise. |
MusicIP not only requires the plugin itself, but also a working MusicIP application setup. If the plugin can't find the application, it wouldn't initialise. OK. So this the application described on the "Spicefly" website? For this documentation task, can I suggest that MusicIP second priority behind Favorites and RandomPlay Suggest that the way forwards would be for MusicIP and friends to get their own documentation page which would cover:-
Related suggestion: |
@edgar-vincent I have another couple of tasks I had committed to but not done, so pleased if someone else picks up this work. I had been intending to revisit the CLI docn page with a view to adding in some examples of JSON output which (imho) makes things much more readable - particularly when the output contains loops. Running the commands like this has also meant that I have been able to verify that things works, and the docn is indeed accurate, To that end, I have some Python code which I have used to run JSON commands. Can share that with you if that might be useful to you, |
@Daksol Absolutely. I've got
Excellent idea.
Please do! Thanks a lot. |
MIP is not a third party plugin, but part of LMS. Therefore it's not in that list. And as spicefly does a great job describing things already, I'd leave the documentation there. Let's concentrate on migrating the CLI documentation only here. But yes, the MIP CLI isn't that important, can probably be left alone. I guess that most people using MIP nowadays do so using spicefly's plugin rather than the built-in version. |
Michael. Will follow your guidance. Appreciated. |
@edgar-vincent I have submitted a pull request which includes a link to a Python module in a repository, and a documentation page of python examples. So in meantime I have attached the link to the module (Docn page which will be published now updated to hold info about multiple languages, not just Python) Links to Files |
@mherger Michael Thanks for your response to the pull request including a Python module. Couple of questions below. My original thinking was - does the LMS-Community need yet another repository to support? So I tried to make something as light as it possibly could be to get people up to speed quickly. Hence .py module with hardly 20 lines of code with only one dependency ( But I take your point - code should live in repositories designed to manage code. I will set up a repo on Github ("daksol/lms-cli-minimal" ?) with the stated purpose of providing minimal code to get people productive with the LMS CLI. I will set it up to support multiple languages, starting with Python. I will find something similar for Javascript. Questions:-
Background on LMS CLI Python repos fyi my thinking here influenced by my original attempts to find some Python code - which revealed a fair number of stale projects. And no desire to create another one.... When I first looked for some Python to work with LMS I took some quick looks at Github, and mostly found Archived or Obsolete repos. I asked a question in the LMS Developer forums and @daverz kindly shared some code which formed the basis of what I am still working with. I just took at deeper dive, searching with more terms (squeeze, slim, logitech, lms etc), looking particularly at Pypi (pypi.org) which is the most widely used Python module library - once you have set a default library in a local Python setup, "pip install xx-mypackage-xx" gets it for you. This produced around 18, of which 7 have been updated in last three years. So many have become stale, but I would guess that is not unusual. Repo status:-
|
Command line interface - CLI commands documentation
Some (not high priority) issues which came up when doing some further testing of the CLI - done mostly with the intention of generating some more examples, particularly JSONRPC ones, which are (IMHO) heaps easier to read.
PURPOSE OF ID PARAMETER WITH JSONRPC ?
See JSONRPC section of Using the CLI
Question about the "id" parameter for JSONRPC. In the JSONRPC notes for use by CURL etc, one of the parameters passed is "id" (along with "params" and "method"). I realise that when running the commmands via JSON I have not included "id" and it still seems to work.
What is its function? - maybe to allow the response to multiple JSONRPC calls to be easily distinnguished?
PLAYER COMMAND INCONSISTENCIES
I was doing some followup checking on behaviour of certain CLI commands for Players.
The command
players
provides full info about all connected players; this works fine, documentation is inline with behaviour.There is also group of eight commands like "player name" which return a specific piece of info about a particular player.
The subcommands are: name, uuid, displaytype, id, ip, model, isplayer, canpoweroff
These commands have more than one format to achieve the same result - based on the documentation and examples given. The variants are wrt the parameter used (
playerid
orplayerindex
) and where the parameter is placed (as a pre-pended player identifier or after the 'player ' bit).Syntax Options with Player identifier after the
player <subcommand>
stringplayer name <playerindex> ?
player name <playerid> ?
where
<playerid>
is (usually) the player's MAC address, and<playerindex>
is a sequence number assigned to players currently recognised by the server, with values like 0, 1, 2 etcSyntax options where Player identifier precedesthe
player <subcommand>
stringSome places in the documentation it is shown that these two forms are also permissable.
<playerindex> player name ?
<playerid> player name ?
See for instance syntax and examples for
player name
Testing results
All of these formats (SYNTAX-1 thru -4) "work" in that they return a result; but I noticed some discrepancies.
So we need to test all four formats for eight subcommands for four players (as one does).
name, uuid, displaytype, id, ip, model, isplayer, canpoweroff
)And compared the results with what comes back from the
players
commandResult of this testing is that SYNTAX-3, and SYNTAX-4 while they work (in that a result is returned) do not provide an accurate response. They seem to always return information about the player currently with Index 0.
Suggested actions:
@mherger - Your call as whether this should be raised as a bug?
The text was updated successfully, but these errors were encountered: