Metadata-Version: 2.4
Name: python-duco-connectivity
Version: 0.1.1
Summary: Async HTTP client for the local Duco Connectivity API
Author: Ronald van der Meer
License-Expression: MIT
Project-URL: Homepage, https://github.com/ronaldvdmeer/python-duco-connectivity
Project-URL: Repository, https://github.com/ronaldvdmeer/python-duco-connectivity
Project-URL: Issues, https://github.com/ronaldvdmeer/python-duco-connectivity/issues
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Home Automation
Classifier: Framework :: AsyncIO
Classifier: Typing :: Typed
Requires-Python: >=3.12
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: aiohttp>=3.9.0
Provides-Extra: dev
Requires-Dist: aioresponses>=0.7; extra == "dev"
Requires-Dist: bandit>=1.7; extra == "dev"
Requires-Dist: mypy>=1.8; extra == "dev"
Requires-Dist: pip-audit>=2.7; extra == "dev"
Requires-Dist: pytest>=8.0; extra == "dev"
Requires-Dist: pytest-asyncio>=0.23; extra == "dev"
Requires-Dist: pytest-cov>=5.0; extra == "dev"
Requires-Dist: ruff>=0.11; extra == "dev"
Dynamic: license-file

# 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:

```bash
pip install git+https://github.com/ronaldvdmeer/python-duco-connectivity.git
```

After the package is published on PyPI, install it with:

```bash
pip install python-duco-connectivity
```

## Current scope

- HTTP only
- asynchronous communication via `aiohttp`
- typed models that stay close to the API response shape

## Public API surface

The current client exposes:

- `async_get_api_info()` for `GET /api`
- `async_get_board_info()` for `GET /info?module=General&submodule=Board`
- `async_get_lan_info()` for `GET /info?module=General&submodule=Lan`
- `async_get_nodes()` for `GET /info/nodes`
- `async_get_diagnostics()` for `GET /info?module=Diag`
- `async_get_write_requests_remaining()` for `GET /info?module=General&submodule=PublicApi`
- `async_set_ventilation_state()` for `POST /action/nodes/{node}` with `SetVentilationState`

The model layer includes `ApiInfo`, `BoardInfo`, `LanInfo`, `Node`,
`NodeGeneralInfo`, `NodeVentilationInfo`, and `NodeSensorInfo`.

## Development

Install the development dependencies and run the same checks as CI:

```bash
pip install ".[dev]"
pytest
ruff check src tests
ruff format --check src tests
mypy src
bandit -r src -ll
pip-audit --desc on
```

## Validation

The current API surface was validated against a real Duco box during the first
development pass, covering:

- `GET /api`
- `GET /info?module=General&submodule=Board`
- `GET /info?module=General&submodule=Lan`
- `GET /info/nodes`
- `GET /info?module=General&submodule=PublicApi`
- `POST /action/nodes/{node}` with a no-op `SetVentilationState`

