homelab-codex-ws/scripts/ha/tests/fixtures
oskar 5b9111afa7 feat(ha): api adapter for import.sh
ken is HAOS (no SSH/docker exec path), so it needs a REST/WebSocket-only
adapter: automations/scripts/scenes via one GET per
/api/config/<domain>/config/<id>, dashboards/area+entity registries/
input_* helpers via the HA WebSocket API (read-only commands only).

scripts/ha/lib/ha_api.py and ha_ws.py never take a token as a value —
only a token_path, read from disk in-process — so the bearer token never
touches a subprocess argv or a log line. ha_ws.py depends on the optional
websocket-client package and raises a clear, actionable ImportError if
it's missing rather than a raw traceback; import.sh still completes the
REST-only part of the import in that case.

Automations/scripts/scenes reuse split.write_split() so both adapters
produce byte-identical config/<instance>/ layouts and the same
idempotent stale-file cleanup on re-run.

docker-exec adapter logic is untouched.
2026-07-22 18:07:26 +02:00
..
api_automation_config_111.json feat(ha): api adapter for import.sh 2026-07-22 18:07:26 +02:00
api_scene_config_222.json feat(ha): api adapter for import.sh 2026-07-22 18:07:26 +02:00
api_script_config_demo_script.json feat(ha): api adapter for import.sh 2026-07-22 18:07:26 +02:00
api_states.json feat(ha): api adapter for import.sh 2026-07-22 18:07:26 +02:00
automations.yaml feat(ha): skeleton for Home Assistant configs-as-code subproject 2026-07-21 15:29:39 +02:00
configuration.yaml fix(ha): normalize.py round-trips custom HA !tag nodes 2026-07-21 17:41:12 +02:00