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.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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pymotivaxmc2-0.6.7.tar.gz.
File metadata
- Download URL: pymotivaxmc2-0.6.7.tar.gz
- Upload date:
- Size: 20.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0649c7a6ee4b3e6c44b4f2f7798dad217f432d6038cd7bd1e293b097935a0dca
|
|
| MD5 |
7198118639a4674a98f5cae42d19041e
|
|
| BLAKE2b-256 |
fd76be7d272a04aead4f993bb8ec7709b9643683190436cfc55c522dee4a8795
|
Provenance
The following attestation bundles were made for pymotivaxmc2-0.6.7.tar.gz:
Publisher:
release.yml on droman42/pymotivaxmc2
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pymotivaxmc2-0.6.7.tar.gz -
Subject digest:
0649c7a6ee4b3e6c44b4f2f7798dad217f432d6038cd7bd1e293b097935a0dca - Sigstore transparency entry: 236977659
- Sigstore integration time:
-
Permalink:
droman42/pymotivaxmc2@521a8922b299ba936ede10e98e94f8c0ec9a6ce2 -
Branch / Tag:
refs/tags/v0.6.7 - Owner: https://github.com/droman42
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@521a8922b299ba936ede10e98e94f8c0ec9a6ce2 -
Trigger Event:
push
-
Statement type:
File details
Details for the file pymotivaxmc2-0.6.7-py3-none-any.whl.
File metadata
- Download URL: pymotivaxmc2-0.6.7-py3-none-any.whl
- Upload date:
- Size: 23.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
994a5f9cfe9b46b76a15f322cd4d15993817c930c131126c279f9fa053abda06
|
|
| MD5 |
d3044034cb058ee1cc1c06702a52225f
|
|
| BLAKE2b-256 |
c7d412d88e8fbd1cb7d2d009778c6795ac1b1a10a82b2ed87dedd6e286a19fee
|
Provenance
The following attestation bundles were made for pymotivaxmc2-0.6.7-py3-none-any.whl:
Publisher:
release.yml on droman42/pymotivaxmc2
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pymotivaxmc2-0.6.7-py3-none-any.whl -
Subject digest:
994a5f9cfe9b46b76a15f322cd4d15993817c930c131126c279f9fa053abda06 - Sigstore transparency entry: 236977661
- Sigstore integration time:
-
Permalink:
droman42/pymotivaxmc2@521a8922b299ba936ede10e98e94f8c0ec9a6ce2 -
Branch / Tag:
refs/tags/v0.6.7 - Owner: https://github.com/droman42
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@521a8922b299ba936ede10e98e94f8c0ec9a6ce2 -
Trigger Event:
push
-
Statement type: