Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

pylabgruppen-ipx

Asyncio Python client for controlling Lab.gruppen IPX amplifiers over the network. It has no dependencies outside the standard library.

Currently tested on the following hardware:

  • IPX 1200, Firmware 2.3.5.0 / 2.3.2.0 (20190612)

Instalation and usage

CLI

Install the package from PyPI:

uv tool install pylabgruppen-ipx

Find amplifiers on the local network. Discovery runs until you press Ctrl+C (or until --timeout).

> pylabgruppen-ipx discover
MODEL             HOST              PORT  MAC
----------------  ---------------  -----  -----------------
IPX 1200          192.168.1.50     50168  00:11:22:33:44:55

Control an amplifier by its IP address or hostname:

pylabgruppen-ipx status 192.168.1.50
pylabgruppen-ipx power 192.168.1.50 on
pylabgruppen-ipx recall 192.168.1.50 2
Command Description
discover [--timeout SECONDS] Discover amplifiers on the local network
status HOST Show state and details
power HOST {on,off} Power on or off (standby)
mute HOST OUTPUT {on,off} Mute or unmute an output (numbered from 1)
presets HOST Show stored presets
recall HOST ID Recall (activate) a preset

Use --help for all information on all commands and possible arguments.

Library

Add the package to your project's dependencies, or install it with pip:

pip install pylabgruppen-ipx

Discovering amplifiers

import asyncio

from pylabgruppen_ipx import IPXDiscovery

async def main() -> None:
    async with IPXDiscovery() as discovery:
        await asyncio.sleep(5)

    for amp in discovery.amplifiers:
        print(amp.model, amp.host, amp.port, amp.mac)

asyncio.run(main())

Or keep scanning in the background and get a callback for each new or changed amplifier:

from pylabgruppen_ipx import DiscoveredIPXAmplifier, IPXDiscovery

def on_found(amp: DiscoveredIPXAmplifier) -> None:
    print(f"Found {amp.model} at {amp.host}")

discovery = IPXDiscovery(on_found=on_found)
await discovery.scan()
...
await discovery.stop()

Controlling an amplifier

from pylabgruppen_ipx import IPXAmplifier, IPXError

try:
    async with IPXAmplifier("192.168.1.50") as amp:
        ...
except IPXError as err:
    print(f"Error: {err}")

The amplifier pushes meter readings and temperature on its own schedule while powered on. Pass on_frame_received to receive each unsolicited push:

from pylabgruppen_ipx import IPXAmplifier, IPXFrame, IPXFrameMessageClass
from pylabgruppen_ipx.amp.protocol import ADDR_TEMPERATURE
from pylabgruppen_ipx.amp.utils import u32_at

def print_frame(frame: IPXFrame) -> None:
    if frame.msg_class == IPXFrameMessageClass.GET:
        if frame.payload[:4] == ADDR_TEMPERATURE:
            print(f"Temperature: {u32_at(frame.payload, 4)} °C")
            return

async def main() -> None:
    async with IPXAmplifier("192.168.1.50", on_frame_received=print_frame) as amp:
        ...

Development

Setup development environment:

git clone https://gitlab.com/iot.imsteven.xyz/pylabgruppen-ipx.git
cd pylabgruppen-ipx
python3 -m venv .venv
source .venv/bin/activate

Run the CLI from the working tree:

PYTHONPATH=src python3 -m pylabgruppen_ipx discover

Code is formatted with Ruff:

pip install ruff
ruff format src

Project layout:

Path Contents
src/pylabgruppen_ipx/amp/ Protocol, discovery and amplifier connection
src/pylabgruppen_ipx/cli/ Command line interface

Metadata

Release files for pylabgruppen-ipx 0.1.0rc3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pylabgruppen-ipx 0.1.0rc3
File Size Uploaded Provenance Actions
pylabgruppen_ipx-0.1.0rc3.tar.gz 15.4 kB Without provenance Details for pylabgruppen_ipx-0.1.0rc3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pylabgruppen-ipx 0.1.0rc3
File Interpreter ABI Platform Actions
pylabgruppen_ipx-0.1.0rc3-py3-none-any.whl Python 3 none any Details for pylabgruppen_ipx-0.1.0rc3-py3-none-any.whl

Total release size: 35.5 kB

Release files / pylabgruppen_ipx-0.1.0rc3.tar.gz

Download URL pylabgruppen_ipx-0.1.0rc3.tar.gz
Size 15.4 kB
Tags Source
SHA-256 checksum
How to use checksums
a3dd1640decf80638b9f0349d5453b0d23e5e96167d455fba967ec4da9a03b0a
BLAKE2b-256 checksum
How to use checksums
7d010737b1499595ed54f83bf62e8db7b6e626d5aa29c2643408f68dd94c96fd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / pylabgruppen_ipx-0.1.0rc3-py3-none-any.whl

Download URL pylabgruppen_ipx-0.1.0rc3-py3-none-any.whl
Size 20.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b8aa5364ad2285ff615f9d05d6542db29212577c6fe31a6cb17da72688bb5053
BLAKE2b-256 checksum
How to use checksums
98c9b1ceeb9bff744b3641b6b4ff2aebad8bb34507906e4cae6aca9a48ff7d64
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for pylabgruppen-ipx 0.1.0rc3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page