Skip to main content

Async Python library for Busch-Jaeger iNet Radio devices

Project description

Busch-Radio iNet Python Library

Asynchronous Python library for controlling and monitoring Busch-Jaeger iNet Radios via their UDP protocol. Features real-time push notifications for state changes (volume, station, power) from physical buttons.

Installation

pip install inet-control

Quick Start

1. Discover radios on your network

import asyncio
from inet_control import RadioManager

async def discover():
    manager = RadioManager()
    await manager.start()
    
    # Broadcast discover and wait for responses
    await manager.discover()
    await asyncio.sleep(2)  # Wait for responses
    
    for ip, radio in manager.radios.items():
        print(f"{radio.name}{ip}")
    
    await manager.stop()

asyncio.run(discover())

Output:

RADIO-LIVINGROOM → 192.168.1.100
RADIO-KITCHEN → 192.168.1.101

2. Control a radio

import asyncio
from inet_control import RadioManager

async def control():
    manager = RadioManager()
    await manager.start()
    
    # Connect to a specific radio by IP
    radio = await manager.connect("192.168.1.100", timeout=3.0)
    print(f"Connected: {radio.name} (volume={radio.volume}, power={radio.power})")
    
    # Control the radio
    await manager.turn_on(radio)
    await manager.set_volume(radio, 8)
    await manager.play_station(radio, 1)  # Play station preset 1-8
    
    # State is updated automatically via callbacks
    await asyncio.sleep(1)
    print(f"Now playing: {radio.playing_station_name}")
    
    await manager.stop()

asyncio.run(control())

3. Monitor state changes (callbacks)

import asyncio
from inet_control import RadioManager

async def monitor():
    manager = RadioManager()
    await manager.start()
    radio = await manager.connect("192.168.1.100")
    
    # Register callback for any state change
    def on_change():
        print(f"[UPDATE] {radio.name}: vol={radio.volume} power={radio.power} "
              f"station={radio.playing_station_name}")
    
    radio.register_callback(on_change)
    print("Listening for changes... (press Ctrl+C to stop)")
    
    try:
        await asyncio.Future()  # Run forever
    except KeyboardInterrupt:
        pass
    finally:
        await manager.stop()

asyncio.run(monitor())

CLI Usage

The library includes a command-line interface:

# Discover radios
python -m inet_control monitor

# Control a specific radio
python -m inet_control ctl 192.168.1.100 status
python -m inet_control ctl 192.168.1.100 on
python -m inet_control ctl 192.168.1.100 off
python -m inet_control ctl 192.168.1.100 volume 8
python -m inet_control ctl 192.168.1.100 play 3    # Play station 3
python -m inet_control ctl 192.168.1.100 mute

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

inet_control-1.0.0.tar.gz (13.3 kB view details)

Uploaded Source

Built Distribution

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

inet_control-1.0.0-py3-none-any.whl (14.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: inet_control-1.0.0.tar.gz
  • Upload date:
  • Size: 13.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for inet_control-1.0.0.tar.gz
Algorithm Hash digest
SHA256 c1e3299d6194c989fafd3bf9d09ff19ca866c20b298c62b9ac42cc12272fe03c
MD5 6b4b2629e3a416be15b9819d14497c22
BLAKE2b-256 232a79ddb5b51c717d9ebd5250bcc59b5033662e7731b4b6d2198164d557c134

See more details on using hashes here.

Provenance

The following attestation bundles were made for inet_control-1.0.0.tar.gz:

Publisher: publish.yml on JonatanMGit/iNet-control

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: inet_control-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 14.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for inet_control-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0b066354364ee33ce01a4086cbf2229ef196cf884e7c4d964dfca4fe29d32354
MD5 5c9f38f4382969642f57d5071128e327
BLAKE2b-256 fde7661f9e1c8d3637b85540400da3da3b9f22bbf321c0893d36e01b51420778

See more details on using hashes here.

Provenance

The following attestation bundles were made for inet_control-1.0.0-py3-none-any.whl:

Publisher: publish.yml on JonatanMGit/iNet-control

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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