[HOMEASSIST-5] Standalone dev harness with live and mock hass #5

Merged
chris merged 6 commits from feature/HOMEASSIST-5 into main 2026-10-03 16:53:12 -06:00
Owner

Ticket

HOMEASSIST-5 Dashboards: standalone dev harness with real websocket auth and mock-hass mode

Summary

  • New @ha-dashboards/ui/dev: HassSource abstraction, createMockHass/makeEntity (offline + tests), connectLiveHass (home-assistant-js-websocket, long-lived token from VITE_HA_URL/VITE_HA_TOKEN), resolveHarnessMode (live only with both vars and no ?mock; URL validated/normalized), DevHarness (wraps the panel in the real PanelProvider), mountHarness.
  • Map dashboard migrated: main.tsx now calls mountHarness; fixtures and the simulated location-update handler moved to src/mock.ts; old DevHarness.tsx removed. bun run dev map starts it.
  • Token safety: map envDir points at the root .env for dev/preview only (not build), so the token isn't baked into builds; .env.example + README document the exposure and recommend a non-admin HA user's token.
  • Tests: ui 112, map 12 (mock-hass, live source, mode resolution, harness, mount).
  • Note for reviewer: manual browser check of mock/live mode was not done in the sandbox (port 5173 was taken). Avoid exporting VITE_HA_TOKEN in shell/CI when running build, since Vite always inlines VITE_-prefixed process env.

🤖 Generated with Claude Code

https://claude.ai/code/session_01A6WV37dDVNs4Zhq7RQB4ku

## Ticket [HOMEASSIST-5](http://192.168.2.100:7123/home/browse/HOMEASSIST-5/) Dashboards: standalone dev harness with real websocket auth and mock-hass mode ## Summary - New `@ha-dashboards/ui/dev`: `HassSource` abstraction, `createMockHass`/`makeEntity` (offline + tests), `connectLiveHass` (home-assistant-js-websocket, long-lived token from `VITE_HA_URL`/`VITE_HA_TOKEN`), `resolveHarnessMode` (live only with both vars and no `?mock`; URL validated/normalized), `DevHarness` (wraps the panel in the real `PanelProvider`), `mountHarness`. - Map dashboard migrated: `main.tsx` now calls `mountHarness`; fixtures and the simulated location-update handler moved to `src/mock.ts`; old `DevHarness.tsx` removed. `bun run dev map` starts it. - Token safety: map `envDir` points at the root `.env` for dev/preview only (not `build`), so the token isn't baked into builds; `.env.example` + README document the exposure and recommend a non-admin HA user's token. - Tests: ui 112, map 12 (mock-hass, live source, mode resolution, harness, mount). - Note for reviewer: manual browser check of mock/live mode was not done in the sandbox (port 5173 was taken). Avoid exporting `VITE_HA_TOKEN` in shell/CI when running `build`, since Vite always inlines `VITE_`-prefixed process env. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01A6WV37dDVNs4Zhq7RQB4ku
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01A6WV37dDVNs4Zhq7RQB4ku
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01A6WV37dDVNs4Zhq7RQB4ku
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01A6WV37dDVNs4Zhq7RQB4ku
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01A6WV37dDVNs4Zhq7RQB4ku
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01A6WV37dDVNs4Zhq7RQB4ku
[HOMEASSIST-5] Address second-round review findings.
Some checks failed
ticket-done / done (pull_request) Failing after 1s
e67e91e8d5
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01A6WV37dDVNs4Zhq7RQB4ku
chris merged commit fc7397340d into main 2026-10-03 16:53:12 -06:00
chris deleted branch feature/HOMEASSIST-5 2026-10-03 16:53:12 -06:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
chris/home-assistant-dashboards!5
No description provided.