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.7.0.tar.gz (24.8 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.7.0-py3-none-any.whl (27.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for pymotivaxmc2-0.7.0.tar.gz
Algorithm Hash digest
SHA256 8f6bdd50c50bd65938f2f466718e3d4b584dfd2423ecd5345c8b70cc90954c9c
MD5 b8224633032172df446f12c6fa938f56
BLAKE2b-256 a71367eceabc685ae204abb68afd85f40f312bced8752c0207e2b7e9b74d6638

See more details on using hashes here.

Provenance

The following attestation bundles were made for pymotivaxmc2-0.7.0.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.7.0-py3-none-any.whl.

File metadata

  • Download URL: pymotivaxmc2-0.7.0-py3-none-any.whl
  • Upload date:
  • Size: 27.2 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.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 07cdcf3c211c0ca37c36b3f965d3210122e9e207793454724b562343708c02fb
MD5 c8f3b8967f7b8d737fdff3710a0a09c4
BLAKE2b-256 92faa7492ba1253b0a06ed7f41ec66ed3297cc18426d19ef431a1e68fbfc8141

See more details on using hashes here.

Provenance

The following attestation bundles were made for pymotivaxmc2-0.7.0-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