Unsurprisingly, the library is centered around the server. So your first step is to create a server object.
from LMSTools import LMSServer # Define your server address SERVER_IP = "192.168.0.1" # create the server object server = LMSServer(SERVER_IP)
If you don’t know the address of your server you can use the
LMSDiscovery class to find servers.
from LMSTools import LMSServer, LMSDiscovery # Find servers servers = LMSDiscovery().all() if servers: # Get the details of the server SERVER_IP = servers["host"] SERVER_PORT = servers["port"] # create the server object server = LMSServer(SERVER_IP)
At this point, you can test if your connection works by running the Ping method.
Pretty unexciting though, isn’t it?
That’s because you know it’s not the server that really matters, it’s the players. So let’s see how they work in the next section: Controlling/querying your squeezeplayer.