Skip to main content

A Python API for controlling Axion Lighting DMX controllers

Project description

Axion DMX API

Axion DMX API is a Python library to interact with the Axion Lighting DMX Controller. This package allows you to control various types of DMX lighting channels, including RGB, RGBW, and RGBWW.

Installation

Install the package via pip:

pip install libaxion_dmx

Usage

Initialize the API

To use the API, create an instance of the AxionDmxApi class with the IP address of your DMX controller and the password.

from libaxion_dmx import AxionDmxApi

api = AxionDmxApi(host="192.168.1.2", password="your_password")

Get Name

Get the hostname of the controller:

name = await api.get_name()
if name:
    print(f"Successfully retrieved the name of the controller: {name}")

Authenticate

Authenticate with the controller:

authenticated = await api.authenticate()
if authenticated:
    print("Successfully authenticated with the controller.")

Set Channel Level

Set the level of a specific channel:

await api.set_level(channel=1, level=255)

Get Channel Level

Get the current level of a specific channel:

level = await api.get_level(channel=1)
print(f"Channel 1 level: {level}")

Set Color (RGB)

Set the RGB color of a specific channel:

await api.set_color(channel=1, rgb=(255, 0, 0))  # Set to Red

Set RGBW Color

Set the RGBW color of a specific channel:

await api.set_rgbw(channel=1, rgbw=(255, 0, 0, 255))  # Set to Red with White

Set RGBWW Color

Set the RGBWW color of a specific channel:

await api.set_rgbww(channel=1, rgbww=(255, 0, 0, 255, 128))  # Set to Red with Warm White

Testing

To run the tests for this package, use pytest.

License

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

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

libaxion_dmx-1.0.5.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

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

libaxion_dmx-1.0.5-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

Details for the file libaxion_dmx-1.0.5.tar.gz.

File metadata

  • Download URL: libaxion_dmx-1.0.5.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.20

File hashes

Hashes for libaxion_dmx-1.0.5.tar.gz
Algorithm Hash digest
SHA256 e2ac0cf54906437bb784eba89c8a2cb28d8ec3df3601fe448122810649cd4fb3
MD5 1aa18dd559fe89502d613d9a6ec87812
BLAKE2b-256 57f42b0b3ce915fc84f24a51c2d771fd9b1fefee6d3afc1d8ba305eac28d8676

See more details on using hashes here.

File details

Details for the file libaxion_dmx-1.0.5-py3-none-any.whl.

File metadata

  • Download URL: libaxion_dmx-1.0.5-py3-none-any.whl
  • Upload date:
  • Size: 4.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.20

File hashes

Hashes for libaxion_dmx-1.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 e348402cf715cbe72535b98432ff905c8634e2f2e757abdda3be1c15a2b581f1
MD5 0ed41d5635e4277db5682c42665c69c7
BLAKE2b-256 063d174a946cb93330390d55809b59195bff74c0ff4176b7953c8fc7d3dd95bf

See more details on using hashes here.

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