Async HTTP client for the local Duco Connectivity API
Project description
python-duco-connectivity
Async Python client for the local Duco HTTP API.
python-duco-connectivity is a small async client for the unauthenticated
local Duco HTTP endpoints that were validated during initial development. The
library keeps its public models close to the API payload shape and is intended
to stay reusable outside Home Assistant.
Installation
Until the first PyPI release is published, install directly from GitHub:
pip install git+https://github.com/ronaldvdmeer/python-duco-connectivity.git
After the package is published on PyPI, install it with:
pip install python-duco-connectivity
The package also installs a duco-probe CLI and supports module execution for
quick function probes against a local Duco box. When you are not running inside
an activated virtual environment, use the explicit .venv/bin/... paths shown
in the development examples below.
Current scope
- HTTP only
- asynchronous communication via
aiohttp - typed stable config families for the documented
/configbranches - typed models that stay close to the API response shape
- preserved
raw_payloaddata on typed response models for forward compatibility
Diagnostic subsystem reads now keep raw component and status strings from
Diag.SubSystems, so future subsystem names or status values remain available
to downstream consumers without parse fallbacks or product-specific filtering.
Getting started
import asyncio
import aiohttp
from duco_connectivity import DucoClient
async def main() -> None:
async with aiohttp.ClientSession() as session:
client = DucoClient(session, "192.168.1.10")
api_info = await client.async_get_api_info()
nodes = await client.async_get_nodes_overview()
print(api_info.public_api_version)
print([node.node_id for node in nodes])
if __name__ == "__main__":
asyncio.run(main())
Documentation map
Start with docs/api-reference.md when you want a compact inventory of the
public client methods, exports, compatibility aliases, and construction rules.
docs/api-reference.mdfor the central public API inventorydocs/cli.mdfor the function probe CLI and shell examplesdocs/config.mdfor system, node, and zone config reads and writesdocs/live-testing.mdfor local opt-in tests against a real Duco devicedocs/replay-testing.mdfor local sample validation against ignored raw API capturesdocs/actions.mdfor action discovery and executiondocs/nodes.mdfor node models and node information readersdocs/public-api-boundaries.mdfor the typed-model contract and raw escape hatch boundariesdocs/zones.mdfor zone and group info and config readersdocs/ventilation-states.mdfor ventilation enum values and compatibility membersdocs/payload-preservation.mdfor raw payload preservation and raw endpoint access
The public surface keeps a deliberate split between stable typed readers and
broader raw escape hatches. Use the typed methods when the model already
matches the data you need, and use the raw helpers when you need endpoint
coverage, selector flexibility, or payload fields that have not been typed yet.
See docs/public-api-boundaries.md for the full contract.
Testing strategy
The repository uses three automated test layers:
- Synthetic unit tests cover focused parser and client behavior with mocked HTTP responses.
- Local sample-validation tests can replay a small set of typed client methods against your own ignored raw API captures.
- Live tests validate read paths, safe writes, and latency probes against your own Duco device.
That split matters for Duco support. Synthetic tests keep day-to-day iteration fast. Local sample validation lets you check real captures without committing them or maintaining a sanitization workflow. Live tests confirm that the client still behaves correctly against actual hardware.
Public API maintenance
The compact API reference is generated from the published exports and public async client methods. Regenerate it after public surface changes with:
python tools/api_reference.py write
Development
From the repository root, use any activated virtual environment you prefer. The
commands below use a local .venv so they stay copy-pasteable from a clean
checkout. Create it first if needed, then install the development dependencies
and run the same checks as CI:
python -m venv .venv
.venv/bin/python -m pip install -e ".[dev]"
.venv/bin/pytest
.venv/bin/ruff check src tests
.venv/bin/ruff format --check src tests
.venv/bin/mypy src
.venv/bin/bandit -r src -ll
.venv/bin/pip-audit --desc on
For local function probes without activating the environment first:
.venv/bin/python -m duco_connectivity --host 192.168.1.10 call async_get_board_info
.venv/bin/duco-probe --host 192.168.1.10 call async_get_board_info
For local real-device validation against your own Duco box, use the opt-in
workflow documented in docs/live-testing.md.
For local sample validation against ignored raw captures,
use docs/replay-testing.md.
If you want to validate raw API captures locally, follow the layout guidance in
docs/replay-testing.md and the fixture-specific notes in
tests/fixtures/replay/README.md.
Validation
The current API surface was validated against a real Duco box during the first development pass, covering:
GET /apiGET /infowith generic module, submodule, and parameter queriesGET /configwith generic module, submodule, and parameter queriesPATCH /configwith a no-opTimeZonewrite against the current valueGET /info?module=General&submodule=BoardGET /info?module=General&submodule=LanGET /info/nodesGET /info?module=General&submodule=PublicApiPOST /action/nodes/{node}with a no-opSetVentilationState
The repository now also includes opt-in local live tests so the same read and safe-write checks can be repeated against your own device without changing the default mock-only test workflow.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file python_duco_connectivity-0.6.0.tar.gz.
File metadata
- Download URL: python_duco_connectivity-0.6.0.tar.gz
- Upload date:
- Size: 63.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
05e4d486e5da0dfe0c23f8e470efc1a4a801cffca9ffd3d1158a9b13862f46b9
|
|
| MD5 |
7dbfb13d6cc0f425187b9ddcab45361c
|
|
| BLAKE2b-256 |
70b1c5248a379f60045eed0fd7ded133d671e197089ebfc4236f3432da02c263
|
Provenance
The following attestation bundles were made for python_duco_connectivity-0.6.0.tar.gz:
Publisher:
ci.yml on ronaldvdmeer/python-duco-connectivity
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
python_duco_connectivity-0.6.0.tar.gz -
Subject digest:
05e4d486e5da0dfe0c23f8e470efc1a4a801cffca9ffd3d1158a9b13862f46b9 - Sigstore transparency entry: 1710328041
- Sigstore integration time:
-
Permalink:
ronaldvdmeer/python-duco-connectivity@2c5958dc3bf9e73686cef0a6472b24bd81d2c981 -
Branch / Tag:
refs/tags/v0.6.0 - Owner: https://github.com/ronaldvdmeer
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@2c5958dc3bf9e73686cef0a6472b24bd81d2c981 -
Trigger Event:
release
-
Statement type:
File details
Details for the file python_duco_connectivity-0.6.0-py3-none-any.whl.
File metadata
- Download URL: python_duco_connectivity-0.6.0-py3-none-any.whl
- Upload date:
- Size: 29.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b579a11cb4e48281b02fe549c00b516fb997ac7877da3ff7a97cee888823ec13
|
|
| MD5 |
5d44b7f4f512e53180dfe9e09cc52df8
|
|
| BLAKE2b-256 |
127c662eb2fb201db32fdf9e455e409ae2befe975520aad31eb82139675c06cb
|
Provenance
The following attestation bundles were made for python_duco_connectivity-0.6.0-py3-none-any.whl:
Publisher:
ci.yml on ronaldvdmeer/python-duco-connectivity
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
python_duco_connectivity-0.6.0-py3-none-any.whl -
Subject digest:
b579a11cb4e48281b02fe549c00b516fb997ac7877da3ff7a97cee888823ec13 - Sigstore transparency entry: 1710328074
- Sigstore integration time:
-
Permalink:
ronaldvdmeer/python-duco-connectivity@2c5958dc3bf9e73686cef0a6472b24bd81d2c981 -
Branch / Tag:
refs/tags/v0.6.0 - Owner: https://github.com/ronaldvdmeer
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@2c5958dc3bf9e73686cef0a6472b24bd81d2c981 -
Trigger Event:
release
-
Statement type: