ISOLATE (nothing deleted): - moved HA module (ha/, ui/devices/, HA client tests), e2e scripts, and HA docs under deferred/home-assistant/ with a README explaining status + how to revive; complete snapshot preserved on branch deferred/home-assistant REMOVE FROM ACTIVE PRODUCT: - HomeScreen: Devices card + route gone; MainActivity nav updated - ShonarApplication: haRepository removed - BuiltInSettings: Home Assistant category/settings removed from defaults - SettingsManagerTest: secret tests rewritten around a user-created SECRET-type setting (no built-in secret ships) - Manifest + URL-validation test fixture wording neutralized - README/ROADMAP: HA marked deferred with pointer to preserved branch ADD (design, per product direction): - docs/server-providers.md: ShonarProvider interface, Room data model, auth ladder (OIDC/PKCE -> Nextcloud login-flow-v2 -> token paste), sync strategy, provider-selection UX (Nextcloud default; Start9/Umbrel as platform-probe + explicit service binding, never universal APIs; custom SHONAR server; local-only), TLS TOFU pinning policy, no-secret-logging rules, provider contract test strategy, phased plan P0-P7 VERIFY: 19 Android unit tests green, APK builds, on-device launch OK (consent dialog renders; no Devices entry). Backend unchanged (26 tests).
31 lines
1.6 KiB
Markdown
31 lines
1.6 KiB
Markdown
# DEFERRED: Home Assistant integration
|
|
|
|
**Status: deferred — not part of SHONAR's initial product scope.**
|
|
|
|
Home Assistant must not be part of SHONAR's server, storage, authentication,
|
|
onboarding, or default feature set. This directory preserves the work that
|
|
was built (and unit-tested) before the product direction changed, for
|
|
possible future integration. It is excluded from the app build, the default
|
|
settings, the onboarding flow, and the active test plan.
|
|
|
|
**A complete, compilable copy of this integration (module `com.shonar.ha`,
|
|
Devices screen, e2e scripts, docs) is preserved on git branch
|
|
`deferred/home-assistant`.**
|
|
|
|
## What is here
|
|
|
|
| Path | Contents |
|
|
|---|---|
|
|
| `android/src/main/java/com/shonar/ha/` | `HomeAssistantClient` (official REST + WebSocket APIs), `HaRepository`, `HomeAssistantEntity` |
|
|
| `android/src/main/java/com/shonar/ui/devices/` | Devices screen + `HaViewModel` (entity discovery, toggles, live updates) |
|
|
| `android/src/test/java/com/shonar/HomeAssistantClientTest.kt` | 10 MockWebServer tests (401, unreachable, service calls, WS handshake/auth_invalid) |
|
|
| `scripts/ha_e2e_token.sh`, `scripts/ha_e2e_login_flow.sh` | Local-HA e2e auth scripts (official login_flow API, leak-safe) |
|
|
| `docs/home-assistant.md` | Setup/token/troubleshooting guide |
|
|
|
|
## To revive
|
|
|
|
1. `git checkout deferred/home-assistant` (or copy these files back).
|
|
2. Re-add the `HA_*` built-in settings and the `home_assistant` category.
|
|
3. Re-wire `ShonarApplication.haRepository`, the `devices` nav route, and the
|
|
Devices quick-card.
|
|
4. Re-enable the test and run the e2e scripts against a local HA instance.
|