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.6.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.6-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: libaxion_dmx-1.0.6.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.6.tar.gz
Algorithm Hash digest
SHA256 7b043d022890fe8d701b377e81cf956be78178f9adc72ab61b45b5c414b59a9c
MD5 38753859d1bb6d5d59d144df88a34cc7
BLAKE2b-256 c58318e2375c2452c4e30ab218c6fd07e5f0cfb21c7a82d4da75bc898e529583

See more details on using hashes here.

File details

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

File metadata

  • Download URL: libaxion_dmx-1.0.6-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.6-py3-none-any.whl
Algorithm Hash digest
SHA256 5ac1fcbbcd0916767e88f94b03da44e70cee73a8b647731b3b2c87e00fb15faf
MD5 55528a497ce68a8cc5e46fedcdd45909
BLAKE2b-256 a0292bcc4129938700d9256b5508cb517c2551f2773b4e071574e170c7403628

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