Async Python library for discovering and controlling dLight smart lamps over local Wi-Fi. Pure asyncio. Zero dependencies.
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=Trueor a customssl.SSLContext - Typed models —
TypedDictclasses forDeviceState,DeviceInfo,CommandResult - CLI —
python -m dlightclient.cli --discoverfor 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.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| dlight_client-2.0.1.tar.gz | 46.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| dlight_client-2.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 74.8 kB
Release files / dlight_client-2.0.1.tar.gz
| Download URL | dlight_client-2.0.1.tar.gz |
|---|---|
| Size | 46.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
85a10719de52432bdc4e09a92e6750b7cfff42b01b694e6fe68a4683c1e61ecf
|
|
BLAKE2b-256 checksum How to use checksums |
5ff6aab677e961cb83cce57d8a80d9edc3ac58784a4a5bd46e6322ea00b63084
|
| 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 logRelease files / dlight_client-2.0.1-py3-none-any.whl
| Download URL | dlight_client-2.0.1-py3-none-any.whl |
|---|---|
| Size | 28.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2792681a411981d4c01e1fec295ff0a3d98f28eb75fe4146dff264b24aebc388
|
|
BLAKE2b-256 checksum How to use checksums |
d2a7de35f4af665661c5501a333c9d8209263aea03af06cecd43da0d63698da6
|
| 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