Skip to main content

aiotrimlight

CI

aiotrimlight is an asynchronous Python client for the Trimlight Edge Pro local HTTP API. It provides device metadata, runtime light state, high-level power, brightness and static color control, and saved scene queries and playback.

Requirements

  • Python 3.14 or newer.
  • A Trimlight controller with the V3 local HTTP API.
  • The client and controller must be reachable on the same local network.

Installation

python -m pip install aiotrimlight

For source development:

git clone https://github.com/spdevpro/trimlight-ha-api.git
cd trimlight-ha-api
uv sync --locked --group test --python 3.14

Usage

import asyncio

from aiohttp import ClientSession

from aiotrimlight import TrimlightClient


async def main() -> None:
    async with ClientSession(trust_env=False) as session:
        client = TrimlightClient("192.0.2.10", session)

        device = await client.get_device_info()
        state = await client.get_light_state()
        print(device, state)

        await client.set_light_state(
            on=True,
            brightness=64,
            red=255,
            green=255,
            blue=255,
            warm_white=0,
            cold_white=0,
        )


asyncio.run(main())

Replace the example address with the controller's LAN IP address.

trust_env=False prevents system proxy settings from routing local controller traffic through an HTTP proxy.

Discovery metadata exposes both the normalized DID and the full MAC address encoded by the firmware:

from aiotrimlight import parse_discovery_properties

discovery = parse_discovery_properties({"did": "544c0003020000000001"})
print(discovery.did)  # 544c0003020000000001
print(discovery.mac_address)  # 02:00:00:00:00:01

Development

uv sync --locked --group test --python 3.14
uv run --no-sync pytest --cov=aiotrimlight --cov-branch --cov-report=term-missing
uv run --no-sync ruff check .
uv run --no-sync ruff format --check .
uv run --no-sync mypy src tests
uv build --no-sources --clear
uv run --no-sync twine check dist/*

[!WARNING] examples/turn_on.py sends commands to real Trimlight hardware. Review the configured host and output values before running it.

Releases

Stable releases are built and published through GitHub Actions using PyPI Trusted Publishing.

License

aiotrimlight is distributed under the MIT License. See LICENSE.

Metadata

Release files for aiotrimlight 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for aiotrimlight 0.3.0
File Size Uploaded Provenance Actions
aiotrimlight-0.3.0.tar.gz 84.5 kB With provenance Details for aiotrimlight-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for aiotrimlight 0.3.0
File Interpreter ABI Platform Actions
aiotrimlight-0.3.0-py3-none-any.whl Python 3 none any Details for aiotrimlight-0.3.0-py3-none-any.whl

Total release size: 93.9 kB

Release files / aiotrimlight-0.3.0.tar.gz

Download URL aiotrimlight-0.3.0.tar.gz
Size 84.5 kB
Tags Source
SHA-256 checksum
How to use checksums
055b21ecbd10aaf7bf7b17e13fbe213e57b46990dcc38aafac2da4315980b783
BLAKE2b-256 checksum
How to use checksums
6ed050bba3cea521114280df3938d3557a1702737ae2224ceeb25364401c79e2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 14, 2026.

Transparency log

Release files / aiotrimlight-0.3.0-py3-none-any.whl

Download URL aiotrimlight-0.3.0-py3-none-any.whl
Size 9.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dd1620159aaea0248ec5b79abbf1e171f83e37c454686d432971074209369ea1
BLAKE2b-256 checksum
How to use checksums
a46f8a6b6c6f945e2eda11c7f1a4f165cf13a88e1e95115b2d6655ed44a00ac7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 14, 2026.

Transparency log

Security for aiotrimlight 0.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for aiotrimlight-0.3.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 14, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page