So like the title says I am attempting to set up an LCD screen that will display the Track and Artist any time the “Skip” or “Previous” button is pressed on my Adafruit 16x2 LCD w/buttons. Is it possible to get the status through the Rest API or will I need to use the websocket API instead? Cheers!
ps. Also, I am relatively new to the whole API game and am looking for learning resources. If anyone has any good reads I would be more than grateful!
What you need is:
However, I will suggest you to use websockets, since you will be automatically notified when the status changes. Just listen on the event:
Let me know if you need more help
Ok, so bear with me here as I am relatively new to all of this. Is the socket.io for python (pypi.python.org/pypi/socketIO-client) still the best method of interacting with the websocket api via python? When I look at documentation for the module it is incredibly overwhelming (I have only a very basic understanding of Python, and coding in general) namely, the creation of an isolated environment (installation) is something that I have not come across before. I suppose it would behoove me to go ahead and read up on isolated environments and work through the ‘Usage’ section on my own just to gain an understanding of what exactly is going on and how it works.
I intend to have this little “Music Server” offline and in my truck the majority of the time, however I aim to create a python file that launches upon startup and allows me to skip, play, pause, volume, etc. via the onboard buttons and shows song info via lcd. So my question is, will the server.io work without an internet connection or would I be better off using the rest API and curl (or python’s request or urllib) to access the localhost address? As you pointed out the status change notification would be a nice addition however, I dont think it would be entirely necessary.
I am not a python expert at all, but in fact socket.io is very very simple.
Just send an ‘emit’ when you want to send a command, and listen with ‘on’.
If you want something very simple, why not using nodejs? I would say it will be simpler for you.
Look at these pre-made examples:
github.com/volumio/Volumio2/blo … layback.js
you just invoke it with the path and the command you want to send (stop, play, next , prev ecc)
and it will report the status. Let me know