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.8.tar.gz (22.3 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.8-py3-none-any.whl (25.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pymotivaxmc2-0.6.8.tar.gz
  • Upload date:
  • Size: 22.3 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.8.tar.gz
Algorithm Hash digest
SHA256 da55a4f45b0b46372f132c71008bfb9d4085859a7cca4708b751e644e089f1e1
MD5 74d6ca2fc8d3d368a5b2e0d6d4ade573
BLAKE2b-256 d26698a03354b8c8d0d9432e10bcc33af34dd1482d6eb21ee43ca7a91527a0c0

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: pymotivaxmc2-0.6.8-py3-none-any.whl
  • Upload date:
  • Size: 25.3 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.8-py3-none-any.whl
Algorithm Hash digest
SHA256 832d88427e31cb0e890bf69ccd0025e946bbb9a3ecddb45584f0c16c6e1e9531
MD5 f2f5885d2aaff1c5931de63e094c3903
BLAKE2b-256 6e87ec89dc8cd736ba68942d03d0db8e5b7a7a342d31a7aff78bf8b564acd4da

See more details on using hashes here.

Provenance

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