Developer Guide¶
Setup¶
git clone https://github.com/mikemccllstr/voltkeeper
cd voltkeeper
uv sync --group dev
mise run setup
Installs dependencies, then sets up pre-commit hooks (lint, format, typecheck) that run automatically on every commit. The CI will catch it if you skip this step, but you’ll save yourself a round-trip.
Architecture¶
voltkeeper is organized into three main packages under src/voltkeeper/:
Package |
Purpose |
|---|---|
|
BLE client, scan, device factory, encryption, handshake |
|
Modbus commands, field struct definitions, device model hierarchy |
|
Per-model device classes (V1 and V2 protocol) |
Top-level modules handle CLI commands (cli.py), device polling (device_handler.py),
MQTT integration (mqtt_client.py), load testing (load_test.py), probe and
annotation (probe.py, annotate.py), and validation (validate.py).
Development workflow¶
All work follows test-driven development. The full quality gate is:
mise run check
This runs lint, typecheck, and tests. Individual checks:
Task |
What it runs |
|---|---|
|
Ruff linter |
|
Mypy type checker |
|
Pytest with branch coverage |
|
Pytest without coverage overhead |
|
Ruff formatter (applies changes) |
|
Install pre-commit hooks (run once after cloning) |
|
Ruff formatter (check only) |
Building documentation¶
mise run docs
Builds both HTML and man page output from the Sphinx source tree.
Commit style¶
Lowercase imperative, single line, no period:
add cipher module: aes-128-cbc with chained iv per FINDINGS §15.8
Adding a new device¶
See Contributing Devices for the contributor guide and Maintainer Guide for merging submissions.