Skip to content

Commit 6a51b3e

Browse files
docs: update copilot instructions and getting-started for IoT + init-remote
- Add IoT section to copilot-instructions (drivers/, Protocol pattern, mock fixtures, deploy recipe) - Update getting-started Next steps to reference `just init-remote` instead of manual Pages setup - Add device.yaml setup step when use_iot=true Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 67f8897 commit 6a51b3e

2 files changed

Lines changed: 25 additions & 1 deletion

File tree

template/.github/copilot-instructions.md.jinja

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ uv add --dev <package> # dev/test dependency
5858
{%- if use_ml %}
5959
uv add --optional ml <package> # optional ML extras
6060
{%- endif %}
61+
{%- if use_iot %}
62+
uv add --optional iot <package> # optional IoT extras
63+
{%- endif %}
6164
```
6265

6366
Always commit `uv.lock` after adding dependencies.
@@ -104,6 +107,22 @@ Always commit `uv.lock` after adding dependencies.
104107
- Release process and versioning details: `docs/releasing.md`
105108
{% endif %}
106109

110+
{% if use_iot %}
111+
## IoT / Embedded Development
112+
113+
- **Drivers live in** `src/{{ package_name }}/drivers/` — serial (`serial.py`), GPIO (`gpio.py`), MQTT (`mqtt.py`)
114+
- **Device config**: `config/device.yaml` (gitignored) — copy from `config/device.yaml.example`
115+
- **Abstractions**: all hardware access goes through `typing.Protocol` interfaces — never import `serial`/`gpiozero`/`paho` directly in business logic
116+
- **Testing without hardware**: use `mock_serial` and `mock_gpio` fixtures from `tests/conftest.py` (autouse for GPIO); MQTT tests require a local Mosquitto broker or skip gracefully
117+
118+
```bash
119+
just deploy <host> # rsync src/ + restart systemd service (or docker pull + compose up if use_docker)
120+
```
121+
122+
- **paho-mqtt**: import as `paho.mqtt.client` and always construct with `CallbackAPIVersion.VERSION2` (paho 2.x+)
123+
- **GPIO**: use `gpiozero` — `Device.pin_factory = MockFactory()` in test fixtures for CI-safe testing
124+
{% endif %}
125+
107126
## What NOT to Do
108127

109128
- Do not bypass `uv` with `pip install` — always use `uv add` or `uv run`

template/docs/getting-started.md.jinja

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,15 @@ Docstrings are auto-rendered as [API documentation](api.md) by mkdocstrings.
104104
## Next steps
105105

106106
- Add your runtime dependencies to `pyproject.toml`
107-
{%- if use_docs %}
107+
{%- if ci_github %}
108+
- Run `just init-remote` to create the GitHub repo, push, configure branch protection{% if use_docs %}, and enable Pages{% endif %}
109+
{%- elif use_docs %}
108110
- Enable [GitHub Pages](https://docs.github.com/en/pages) for documentation hosting
109111
{%- endif %}
110112
{%- if testing != 'minimal' %}
111113
- Connect [Codecov](https://codecov.io/) for PR coverage reports
112114
{%- endif %}
115+
{%- if use_iot %}
116+
- Copy `config/device.yaml.example` to `config/device.yaml` and fill in your device addresses
117+
{%- endif %}
113118
- See [Contributing](contributing.md) for the full development guide

0 commit comments

Comments
 (0)