Dependency lite and micropython friendly library for interacting with Lyrion Music Server systems
Project description
micropyLMS
A dependency lite and micropython friendly library for interacting with Lyrion Music Server (LMS) systems
Overview
This library is intended to help build micropython based LMS controller projects. LMS allows for multiple players to simultaneously play separate streams and most commands and queries have to be represented as coming from one of the players connected to the server. Because of this, the bulk of the library is the player class that allows the creation of an object to hold information about and interaction methods for an LMS player.
A player object only needs to be created once. Any commands can be issued via the class methods. The various class attributes store some useful information on the last updated status of the player. Other information can be retrieved with the generic player_query() method. To insure that the information is current the status_update() method should be called. So for example, if the song playing has moved on since the last status_update() call the player.title, player.artist, and player.album information will all refer to that previous song until status_update() is called again.
Installation
pip install micropyLMS
Example Setup
The following code snippet shows how to initialize and use a simple setup
import micropyLMS
host = "192.168.1.5" # Change this to the specific local URL for your LMS server.
player_name = "Lounge" # Change to the name of the specific player.
server_url = micropyLMS.build_url(host)
player = micropyLMS.get_player(server_url,player_name)
player.status_update()
player.set_volume(50) # Sets the volume to half the maximum.
player.play() # Starts the playback. Enjoy your music.
...
Advanced Usage
There are a wide varied of commands and queries that could be issued that are less commonly used than the ones implemented in this library. For that reason, the Player class has a generic player_query() method and the library has a generic query function core_query() for non-player queries. Constructing valid arguments for these function is a little more complicated. For full information on how to structure the argument or arguments that go in the place of *command for these functions see https://lyrion.org/reference/cli/using-the-cli/ under the jsonrpc.js section and the command part of the body of the request.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file micropylms-1.0.1.tar.gz.
File metadata
- Download URL: micropylms-1.0.1.tar.gz
- Upload date:
- Size: 7.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c433cb1cfffe2114d52fcba822c091ee4ec16db9321be6cee034aa49c739de54
|
|
| MD5 |
039dd4e1085bb6323085514a3b88ca81
|
|
| BLAKE2b-256 |
cb5b77c05cd61dba19a23a7d09eb49525135909d6c32e4e85171901bb028e169
|
File details
Details for the file micropylms-1.0.1-py3-none-any.whl.
File metadata
- Download URL: micropylms-1.0.1-py3-none-any.whl
- Upload date:
- Size: 8.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3c11b37aae49af57db4722cc0202b11c578bb349a2138800277ed219c8bfa388
|
|
| MD5 |
92074b7eaca8023e2bd21a457e5d107c
|
|
| BLAKE2b-256 |
b8ad4bfb30a7672a6ebf903dcaea84d453f4f1e898f9ca7df0feaac37bc3dde8
|