Feature 18 — HA Integration as API Client (feature → dev)
Converts the Home Assistant integration from the owner of the NestQuest database into a thin client of the NestQuest API (Feature 16), preserving the entity and event surface the panel cards and the four automation blueprints depend on. This is the Feature 18 integration PR (all required tasks complete).
Delivered
api_client.py — HTTP client for the panel plane: get_snapshot(), complete_instance(id, actor_child_id), and stream_events() (SSE); typed NestQuestApiError for transport/non-2xx failures; base URL + panel token read from config (options flow + strings/translations); injectable session (no network in tests).
coordinator.py — polls GET /api/v1/panel/snapshot on its interval and rebuilds the existing core snapshot dataclasses, so every existing sensor entity_id and the per-child instance attribute payload shape are unchanged. Adds a configured staleness threshold and a last-good snapshot cache: within the threshold a failed fetch serves cached data (entities stay available); past it, entities go unavailable; the next success recovers without a reload.
sse.py — subscribes to the API SSE transition stream and re-fires the four HA bus events locally with the documented payloads; torn down on unload.
services.py — nestquest.complete_quest proxies to the API (the API is now the writer of record); the ten HA admin services and the permission gate are removed.
Database ownership removed — the integration creates no SQLite file, runs no migrations, and has no DAO/engine/business modules of its own (those live only in the bundled core/); grep -r "aiosqlite|nestquest.db|sqlite3" custom_components/nestquest/ returns nothing outside core/.
Verification
TZ=UTC uv run pytest -q → 1675 passed (the drop from the pre-feature 1770 is the removed DB-wiring and admin-service tests).
TZ=UTC uv run pytest -q orchestration_tests → 14 passed.
Every task PR was independently reviewed by Claude Sonnet 5 (high) at its exact head; three required remediation cycles.
Notes
The feature branch is 7 commits ahead of dev (d78ef19) and includes it as its base (no dev merge needed).
Replan during execution: the last two tasks' dependency order was swapped (remove the HA admin services before the database they used). Deferred low-severity nits are recorded on the individual Maestro tasks.
## Feature 18 — HA Integration as API Client (feature → dev)
Converts the Home Assistant integration from the owner of the NestQuest database into a thin client of the NestQuest API (Feature 16), preserving the entity and event surface the panel cards and the four automation blueprints depend on. This is the Feature 18 integration PR (all required tasks complete).
### Delivered
- **`api_client.py`** — HTTP client for the panel plane: `get_snapshot()`, `complete_instance(id, actor_child_id)`, and `stream_events()` (SSE); typed `NestQuestApiError` for transport/non-2xx failures; base URL + panel token read from config (options flow + strings/translations); injectable session (no network in tests).
- **`coordinator.py`** — polls `GET /api/v1/panel/snapshot` on its interval and rebuilds the existing core snapshot dataclasses, so every existing sensor entity_id and the per-child instance attribute payload shape are unchanged. Adds a configured staleness threshold and a last-good snapshot cache: within the threshold a failed fetch serves cached data (entities stay available); past it, entities go unavailable; the next success recovers without a reload.
- **`sse.py`** — subscribes to the API SSE transition stream and re-fires the four HA bus events locally with the documented payloads; torn down on unload.
- **`services.py`** — `nestquest.complete_quest` proxies to the API (the API is now the writer of record); the ten HA admin services and the permission gate are removed.
- **Database ownership removed** — the integration creates no SQLite file, runs no migrations, and has no DAO/engine/business modules of its own (those live only in the bundled `core/`); `grep -r "aiosqlite|nestquest.db|sqlite3" custom_components/nestquest/` returns nothing outside `core/`.
### Verification
- `TZ=UTC uv run pytest -q` → **1675 passed** (the drop from the pre-feature 1770 is the removed DB-wiring and admin-service tests).
- `TZ=UTC uv run pytest -q orchestration_tests` → **14 passed**.
- Every task PR was independently reviewed by Claude Sonnet 5 (high) at its exact head; three required remediation cycles.
### Notes
- The feature branch is 7 commits ahead of `dev` (`d78ef19`) and includes it as its base (no dev merge needed).
- Replan during execution: the last two tasks' dependency order was swapped (remove the HA admin services before the database they used). Deferred low-severity nits are recorded on the individual Maestro tasks.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Feature 18 — HA Integration as API Client (feature → dev)
Converts the Home Assistant integration from the owner of the NestQuest database into a thin client of the NestQuest API (Feature 16), preserving the entity and event surface the panel cards and the four automation blueprints depend on. This is the Feature 18 integration PR (all required tasks complete).
Delivered
api_client.py— HTTP client for the panel plane:get_snapshot(),complete_instance(id, actor_child_id), andstream_events()(SSE); typedNestQuestApiErrorfor transport/non-2xx failures; base URL + panel token read from config (options flow + strings/translations); injectable session (no network in tests).coordinator.py— pollsGET /api/v1/panel/snapshoton its interval and rebuilds the existing core snapshot dataclasses, so every existing sensor entity_id and the per-child instance attribute payload shape are unchanged. Adds a configured staleness threshold and a last-good snapshot cache: within the threshold a failed fetch serves cached data (entities stay available); past it, entities go unavailable; the next success recovers without a reload.sse.py— subscribes to the API SSE transition stream and re-fires the four HA bus events locally with the documented payloads; torn down on unload.services.py—nestquest.complete_questproxies to the API (the API is now the writer of record); the ten HA admin services and the permission gate are removed.core/);grep -r "aiosqlite|nestquest.db|sqlite3" custom_components/nestquest/returns nothing outsidecore/.Verification
TZ=UTC uv run pytest -q→ 1675 passed (the drop from the pre-feature 1770 is the removed DB-wiring and admin-service tests).TZ=UTC uv run pytest -q orchestration_tests→ 14 passed.Notes
dev(d78ef19) and includes it as its base (no dev merge needed).Independent Claude Sonnet 5 review completed for this exact commit.