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.0.tar.gz (7.4 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.0-py3-none-any.whl (8.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: micropylms-1.0.0.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

Hashes for micropylms-1.0.0.tar.gz
Algorithm Hash digest
SHA256 7857e4c0faf97b50ffe33eb7357af53fa91c5d0972cd5a10f1f04dd66ce15c40
MD5 f35e9d69ca8d2b7019a41d87cfa4fcfd
BLAKE2b-256 2ad29632707d0f73088fceb5f06be41cb4c1c7e783dd61f599d47a1d8eb96cf4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: micropylms-1.0.0-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

Hashes for micropylms-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5b9a8010f263534fa5b4f67cb70fbcb78cfc1487746f19ba102265f99d00e667
MD5 32e111de276bc214a8bea0df1133a92f
BLAKE2b-256 84b82c397cdad34a7914281f5b74dd71189b043357268da7d5eb3c251a1e754c

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