Skip to main content

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

micropylms-1.0.3.tar.gz (7.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

micropylms-1.0.3-py3-none-any.whl (8.5 kB view details)

Uploaded Python 3

File details

Details for the file micropylms-1.0.3.tar.gz.

File metadata

  • Download URL: micropylms-1.0.3.tar.gz
  • Upload date:
  • Size: 7.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for micropylms-1.0.3.tar.gz
Algorithm Hash digest
SHA256 e17c12c9ca47a8aeb9a6880239a94ddb03b1e104038b0413f098b010fae58e36
MD5 3e433ece3858ffcb11577ad62d784151
BLAKE2b-256 18763ca0d3c414a9e452a36e56fa1e66573b613a6e51254c58468d2494003963

See more details on using hashes here.

File details

Details for the file micropylms-1.0.3-py3-none-any.whl.

File metadata

  • Download URL: micropylms-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 8.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for micropylms-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 c6c0c8c349bcb78e853ca4c38c2da656acef22822fa8796f035ffcda02c30d76
MD5 bd1230472131806e272072f402d99038
BLAKE2b-256 dbcd4076092bea4a216949578bdfa9542f398f205211312933071122b1789177

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page