Skip to main content
dlight-client

Async Python library for discovering and controlling dLight smart lamps over local Wi-Fi. Pure asyncio. Zero dependencies.

PyPI version Python Versions CI License: MIT Coverage


Install

pip install dlight-client

Python 3.9 – 3.13. No other packages required.

Quick start

import asyncio
from dlightclient import AsyncDLightClient, DLightDevice, discover_devices

async def main():
    devices = await discover_devices()        # UDP broadcast, 3 s window
    info = devices[0]

    async with AsyncDLightClient(persistent=True) as client:
        lamp = DLightDevice(info["ip_address"], info["deviceId"], client)
        await lamp.turn_on()
        await lamp.set_brightness(75)
        await lamp.set_color_temperature(3000) # warm white

asyncio.run(main())

Features

  • Device discovery — UDP broadcast scan; finds all lamps on the local network
  • Persistent connections — connection pool with per-device locking and idle eviction
  • State caching — optimistic updates with automatic rollback on failure
  • Automatic retries — exponential backoff on transient errors (max_retries, retry_backoff)
  • Optional TLS — pass ssl=True or a custom ssl.SSLContext
  • Typed models — TypedDict classes for DeviceState, DeviceInfo, CommandResult
  • CLI — python -m dlightclient.cli --discover for quick exploration
  • Wi-Fi provisioning — send credentials to a lamp in SoftAP mode

CLI

# Discover all lamps
python -m dlightclient.cli --discover

# Interact with a specific lamp
python -m dlightclient.cli --ip 192.168.1.123 --id DL12345

# Debug with verbose output
python -m dlightclient.cli --ip 192.168.1.123 --id DL12345 -vv

Documentation

Full documentation at https://irishsmurf.github.io/dlight-client/

Getting Started Install, discover, first commands
User Guide Discovery, control, connections, error handling
API Reference Full class and method reference
Architecture Internals for contributors
Contributing Dev setup, testing, PR conventions
Changelog What's changed in each release

Upgrade cadence

Patch releases (1.x.Y) are made as needed for bug fixes and security patches. Minor releases (1.X.0) ship new features and are backwards compatible. Major releases (X.0.0) may include breaking changes and are announced in advance via GitHub Issues.

License

MIT — see LICENSE.

Metadata

Release files for dlight-client 2.1.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 dlight-client 2.1.0
File Size Uploaded
dlight_client-2.1.0.tar.gz 46.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for dlight-client 2.1.0
File Interpreter ABI Platform
dlight_client-2.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 75.0 kB

Release files / dlight_client-2.1.0.tar.gz

Download URL dlight_client-2.1.0.tar.gz
Size 46.5 kB
Tags Source
SHA-256 checksum
How to use checksums
ee1a7d130865b06cd211c4567b5016d4e22e197aab7f4ee6c3fbaa6c93ea038a
BLAKE2b-256 checksum
How to use checksums
f4ff56783e395f24e1f7b734da6a775b60115cd302c25b710190e9952d337606
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 Oct 7, 2026.

Transparency log

Release files / dlight_client-2.1.0-py3-none-any.whl

Download URL dlight_client-2.1.0-py3-none-any.whl
Size 28.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7170c50bfee13fc817d8c4849cc548821402615efe22b9a88e9ada6cbe38bcfe
BLAKE2b-256 checksum
How to use checksums
048c366be3c83b939fb4d4979e6e7e7afcaddfdabdb6833084ce53bc9f3d39f7
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 Oct 7, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

2.1.0 This release

2 release files

2.0.1

2 release files

2.0.0

2 release files

1.6.1

2 release files

1.6.0

2 release files

1.5.1

2 release files

1.5.0

2 release files

1.4.0

2 release files

1.2.0

2 release files

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