HA connection hook + Settings UI for URL + token (slice of #5) #8
Labels
No labels
bug
documentation
enhancement
in-progress
test
triage-approved
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Mark/kimi_agent_home_assistant#8
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Parent-Issue: #5
Slice 2 + 3 of issue #5 decomposition. The Home Assistant integration needs two layers before entity browsing is possible: a hook that wraps
src/lib/ha-api.tsand exposes connection state, and a UI where the user enters HA URL + Long-Lived Access Token.Scope (one PR):
src/hooks/useHomeAssistant.tsexportinguseHomeAssistant()returning{ connected, connecting, error, config, connect(url, token), disconnect(), refetch() }.url+tokeninlocalStorageso the connection survives reload.src/components/editor/SettingsDialog.tsx) with HA URL field, token field (password input), Test Connection button, last-error display.Acceptance criteria:
/api/is pinged on mount to verify.npm run build,npm run lint,npm run typecheck(tsc -b) all pass.src/lib/ha-api.ts(the API client already in the local commit for #5) is the only HTTP dependency; no new fetch code paths.Out of scope: