PySrDaliGateway
Python library for Sunricher DALI Gateway (EDA) integration with Home Assistant.
Features
- Async/await support for non-blocking operations
- Device discovery and control (lights, sensors, panels)
- Group and scene management
- Real-time status updates via MQTT
- Energy monitoring support
- Full Type Support: Complete type hints for mypy, Pylance, and pyright
- IDE integration with auto-completion and error checking
Installation
pip install PySrDaliGateway
Device Types Supported
- Lighting: Dimmer, CCT, RGB, RGBW, RGBWA
- Sensors: Motion, Illuminance
- Panels: 2-Key, 4-Key, 6-Key, 8-Key
Requirements
- Python 3.8+
- paho-mqtt>=1.6.0
Testing
Hardware integration tests use pytest with real DALI gateway hardware.
Setup
pip install -e ".[dev]"
Running Tests
# Run default tests (excludes destructive and slow tests)
pytest tests/
# Run all tests including slow (bus scan) tests
pytest tests/ -m ""
# Run only bus scan tests
pytest tests/ -m slow
# Run only destructive tests (e.g. gateway restart)
pytest tests/ -m destructive
# Run a specific test file
pytest tests/test_devices.py -v
# Limit device iterations for faster testing
pytest tests/ --device-limit 3
Gateway Connection
Tests connect to a real gateway using one of three methods (in priority order):
-
CLI parameters — provide credentials directly:
pytest tests/ --direct-sn GW123456 --direct-ip 192.168.1.100 \ --direct-username admin --direct-passwd password123
-
Credential cache — reuses credentials from a previous session, stored in
tests/.gateway_cache.json -
UDP discovery — auto-discovers gateways on the local network
Test Markers
| Marker | Default | Description |
|---|---|---|
destructive |
skip | Tests that disrupt gateway state (e.g. restart) |
slow |
skip | Long-running tests (e.g. bus scan >30s) |
Test Files
| File | Coverage |
|---|---|
test_connection.py |
Discovery, connect, disconnect, reconnection |
test_gateway.py |
Version, status sync, restart (destructive) |
test_devices.py |
Device discovery, read, control, CCT range, sensor params |
test_groups.py |
Group discovery, read, control, brightness |
test_scenes.py |
Scene discovery, read, scene devices |
test_callbacks.py |
Real-time device status callbacks |
test_bus_scan.py |
Bus scan, stop scan (slow) |
Metadata
Release files for PySrDaliGateway 0.21.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pysrdaligateway-0.21.0.tar.gz | 50.3 kB | Without provenance | Details for pysrdaligateway-0.21.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pysrdaligateway-0.21.0-py3-none-any.whl | Python 3 | none | any | Details for pysrdaligateway-0.21.0-py3-none-any.whl |
Total release size: 90.3 kB
Release files / pysrdaligateway-0.21.0.tar.gz
| Download URL | pysrdaligateway-0.21.0.tar.gz |
|---|---|
| Size | 50.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9a89a817b06a8408e83933c01cbc67354fc18ce52ae58c713872afbcc7b8a10b
|
|
BLAKE2b-256 checksum How to use checksums |
5bfbbc43906817e83c979e0c968cb89b31e33ca1c74a8242da12fb4872d62ea3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.8.18
|
Release files / pysrdaligateway-0.21.0-py3-none-any.whl
| Download URL | pysrdaligateway-0.21.0-py3-none-any.whl |
|---|---|
| Size | 40.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
eba918d8334ce7314421913fb25d4221a646ef5a288243a9ce08e7fbb31033be
|
|
BLAKE2b-256 checksum How to use checksums |
ad45aa213f9cc6021792a4170744c6a060788c508ad896d9bacc8caa24825fff
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.8.18
|
Security for PySrDaliGateway 0.21.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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
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.