Skip to main content

Async Python library for Emotiva XMC-2 and related devices

Project description

pymotivaxmc2

A slim asynchronous Python library for controlling Emotiva XMC‑2 (and compatible) devices over their UDP remote interface.

Features

  • Asynchronous API for non-blocking operation
  • Type-safe command and property access via enums
  • Automatic protocol version negotiation
  • Property change notifications
  • Command-line interface for quick testing

Installation

pip install pymotivaxmc2

Quick Start

import asyncio
from pymotivaxmc2 import EmotivaController, Property, Command, Zone

async def main():
    # Create controller for device at 192.168.1.50
    ctrl = EmotivaController("192.168.1.50")
    
    # Connect to the device
    await ctrl.connect()
    
    # Subscribe to volume changes
    await ctrl.subscribe(Property.VOLUME)
    
    # Register callback for volume changes
    @ctrl.on(Property.VOLUME)
    async def vol_changed(value):
        print(f"Volume is now {value} dB")
    
    # Set volume to -25 dB
    await ctrl.set_volume(-25.0)
    
    # Power on the device
    await ctrl.power_on()
    
    # Wait a minute
    await asyncio.sleep(60)
    
    # Disconnect
    await ctrl.disconnect()

if __name__ == "__main__":
    asyncio.run(main())

Command-Line Interface

The package includes a command-line interface for quick testing:

# Power control
emu-cli --host 192.168.1.50 power on
emu-cli --host 192.168.1.50 power toggle

# Volume control
emu-cli --host 192.168.1.50 volume up --step 2
emu-cli --host 192.168.1.50 volume set -28.5

# Zone 2 control
emu-cli --host 192.168.1.50 zone2 power on
emu-cli --host 192.168.1.50 zone2 volume down

# Input selection
emu-cli --host 192.168.1.50 input set hdmi3

# Status query
emu-cli --host 192.168.1.50 status power volume mute input

Documentation

For more detailed documentation, visit pymotivaxmc2.readthedocs.io.

Requirements

  • Python 3.11 or higher
  • typing-extensions 3.7.4 or higher

License

This project is licensed under the MIT License - see the LICENSE file for details.

Version History

  • 0.6.8: Added logical-source selection (select_source) and Input Button name/visibility reads (get_input_names); ack_timeout now configurable
  • 0.6.0: Added full enums and high-level helpers
  • 0.5.0: Improved notification handling
  • 0.4.0: Added command-line interface
  • 0.3.0: Added property subscription
  • 0.2.0: Initial public release

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

pymotivaxmc2-0.6.9.tar.gz (23.6 kB view details)

Uploaded Source

Built Distribution

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

pymotivaxmc2-0.6.9-py3-none-any.whl (26.6 kB view details)

Uploaded Python 3

File details

Details for the file pymotivaxmc2-0.6.9.tar.gz.

File metadata

  • Download URL: pymotivaxmc2-0.6.9.tar.gz
  • Upload date:
  • Size: 23.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pymotivaxmc2-0.6.9.tar.gz
Algorithm Hash digest
SHA256 d917b92cfb508be5fb0e35b22ad4013412c19cb93dc58d50294e468333de3681
MD5 a15ff9c56895c036f855055a0ab53fe1
BLAKE2b-256 e7c52584a3db7e3bec9d45febe7fad035a51dcbc05100d9e6fbb69ce8bd14e21

See more details on using hashes here.

Provenance

The following attestation bundles were made for pymotivaxmc2-0.6.9.tar.gz:

Publisher: release.yml on droman42/pymotivaxmc2

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

File details

Details for the file pymotivaxmc2-0.6.9-py3-none-any.whl.

File metadata

  • Download URL: pymotivaxmc2-0.6.9-py3-none-any.whl
  • Upload date:
  • Size: 26.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pymotivaxmc2-0.6.9-py3-none-any.whl
Algorithm Hash digest
SHA256 afd045cf1bc089f54c677bb6dd95ae02d6dd70b29ad51896b4ba29cbb77d1253
MD5 7610ca25b0b37acf4054661572019ac7
BLAKE2b-256 49f2e600364b7e4bbdd1606421e6675aeebd9052b188f2b626f03fdcfe1d61a4

See more details on using hashes here.

Provenance

The following attestation bundles were made for pymotivaxmc2-0.6.9-py3-none-any.whl:

Publisher: release.yml on droman42/pymotivaxmc2

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