This file is the canonical AI agent guide for this repository.
- Applies to the whole workspace.
- Prefer links to project docs instead of duplicating large policy text.
- Python 3.12+
- uv for Python dependency management
- Node.js (used by formatting hooks)
Setup commands:
npm install
make setupBefore finishing changes, run:
uv run prek run --all-filesUseful test commands:
uv run pytest
uv run pytest --cov=src/bsblan --cov-report=term-missing
uv run pytest --no-cov tests/test_file.py -k test_nameQuality gate expectations:
- Keep total coverage at 95%+.
- Keep patch coverage at 100% for modified lines.
src/bsblan/bsblan.py: main async client (BSBLAN), request handling, lazy loadingsrc/bsblan/constants.py: parameter IDs and name mappingssrc/bsblan/models.py: response models (pydantic) and set-param models (dataclass)src/bsblan/utility.py: helpers and API validationsrc/bsblan/exceptions.py: library exceptionstests/conftest.py: shared pytest fixtures (mock_bsblan)
- Use type hints on all functions.
- Keep line length <= 88 chars (Ruff).
- Response/state models use
pydantic.BaseModel. - Set-parameter payload models use
@dataclass. - Parameter names use
snake_case. - For set operations, send one
/JSrequest per populated parameter. - Treat API v3 as the supported baseline (do not reintroduce v1-only behavior).
Naming patterns to preserve:
legionella_function_*dhw_*
When adding or renaming parameters:
- Query real-device raw data with
examples/fetch_param.py. - Update mappings in
src/bsblan/constants.py. - Update response models in
src/bsblan/models.py. - If settable, update set dataclass and client setter logic.
- Add/adjust tests in
tests/. - Run full validation (
uv run prek run --all-files).
If raw responses are incomplete or data_type is unknown, prefer
EntityInfo[str] | None and avoid guessing numeric types.
- Partial pytest runs can fail coverage gates; use
--no-covfor focused checks. - Missing Node.js dependencies can break formatting hooks.
- Do not confuse comfort/protective/cooling bounds when selecting IDs.
- Contribution and development process:
.github/CONTRIBUTING.md - User-facing usage and setup:
README.md - Developer docs index:
docs/index.md - Getting started examples:
docs/getting-started.md - API reference:
docs/api/client.md
.github/copilot-instructions.mdandCLAUDE.mdshould reference this file.