Hi All-
I'd like to be able to play Pandora or Tune-in Radio stations that I have saved as "Favorites" using pyLMS.
The CLI works fine for this in the following example:
(echo "b8:27:eb:42:f3:82 favorites playlist play item_id:4"; echo "exit") | nc $(192.168.0.107) 9090
However, I'm coding a small project with a unique interface using python and would like to use pyLMS for this function.
I probably have a "mental block" on this. After much googling and reading the pyLMS docs, I cannot understand how pyLMS even loads/starts a user-defined playlist, let alone something from the Favorites playlist.
Any help, examples or clarification?
TIA
Results 1 to 3 of 3
-
2017-04-06, 18:18 #1
- Join Date
- Jul 2010
- Posts
- 8
Question: How to play Favorites from pyLMS?
-
2017-04-06, 23:15 #2
- Join Date
- Nov 2015
- Posts
- 48
Have you got pyLMS running at all? i.e. have you created a server and player object?
If so, you could just do:
Code:player.request("favorites playlist play item_id:4")
Using LMSTools would look like this:
Code:from LMSTools import LMSServer, LMSPlayer server = LMSServer("192.168.0.107") player = LMSPlayer("b8:27:eb:42:f3:82", server) # Play favourites player.request("favorites playlist play item_id:4")
Code:from pylms.server import Server from pylms.player import Player sc = Server(hostname="192.168.0.107") sc.connect() sq = sc.get_player("b8:27:eb:42:f3:82") sq.request("favorites playlist play item_id:4")
Last edited by elParaguayo; 2017-04-06 at 23:28.
-
2017-04-07, 07:14 #3
- Join Date
- Jul 2010
- Posts
- 8
Thanks, elParaguayo! This is exactly what I needed.
I did already have pyLMS working with code similar to your example. I was "sort of" on the right track in my wandering around - I had successfully tested a command-line telnet connection with the favorites playlist load function. I just had not found the player request function in the pyLMS docs yet.