I don’t manage to browse my library with the API.
I read the documentation, the source code and checked what is sent by the webUI interface to be sure of the command.
Typically I should be able to send and receive these websockets :
["listPlaylist", null]
-> ["pushListPlaylist",["Various Artists","YT"]]
and
It only shows the playlists that are listed under “Playlists” (right below Favorites)
If there are none the results of the call will be empty. Add some playlists to the favorites and use the code below to show the results:
You can use code below:
from socketIO_client import SocketIO, LoggingNamespace
import json
def pp_json(json_thing, sort=True, indents=4):
if type(json_thing) is str:
print(json.dumps(json.loads(json_thing), sort_keys=sort, indent=indents))
else:
print(json.dumps(json_thing, sort_keys=sort, indent=indents))
return None
def on_getState_response(*args):
global data
data = args
socketIO.on('pushListPlaylist', on_getState_response)
socketIO.emit('listPlaylist','')
socketIO.on('pushBrowseLibrary', on_browse_response)
socketIO.emit("browseLibrary", {"uri":"music-library"})
I was excepting to see the response of the server on the console debugger from the VolumioUI but it turns out it’s not broadcasting to all connected clients like other listeners !
I also noticed there is no effect of sending the callback as third parameter, even if it should be the correct practice (pypi.python.org/pypi/socketIO-client#usage).
Thanks again for taking the time to create an account, I’m glad to be able to keep exploring this stuff