Compose Home catalog with accessory preferences

This commit is contained in:
Gabriel Brown
2026-08-17 16:35:41 -04:00
parent 925fc0276f
commit c2b19f7545
3 changed files with 303 additions and 55 deletions
@@ -56,20 +56,80 @@ jq -e '.transferActive == false and .ongoingCount == 0' \
|| fail 'phone transfer did not leave Ongoing'
qs ipc call home-assistant fixture ready >/dev/null
home_ready="$(qs ipc call home-assistant status)"
jq -e '
.fixture == true and
.phase == "ready" and
.discoveredCount == 7 and
.configuredCount == 7 and
.visibleCount == 4 and
.selectedIds[0:4] == [
"light.fixture_all",
"light.fixture_kitchen",
"light.fixture_living",
"light.fixture_bedroom"
] and
(.entities[0:4] | map(.name)) == [
"Whole home",
"Kitchen island",
"Living room",
"Bedroom"
] and
.stale == false and
.lastError == ""
' <<<"$(qs ipc call home-assistant status)" >/dev/null \
' <<<"$home_ready" >/dev/null \
|| fail 'ready Home fixture is malformed'
qs ipc call home-assistant brightness light.fixture_living 64 >/dev/null
jq -e '
.entities[] |
select(.id == "light.fixture_living") |
.active == true and .state == "on" and .brightnessPct == 64
' <<<"$(qs ipc call home-assistant status)" >/dev/null \
|| fail 'Home brightness fixture did not update local catalog state'
qs ipc call home-assistant toggle light.fixture_living >/dev/null
jq -e '
.entities[] |
select(.id == "light.fixture_living") |
.active == false and .state == "off"
' <<<"$(qs ipc call home-assistant status)" >/dev/null \
|| fail 'Home toggle fixture did not update local catalog state'
qs ipc call home-assistant fixture missing-selected >/dev/null
jq -e '
.fixture == true and
.phase == "ready" and
.discoveredCount == 7 and
.configuredCount == 8 and
(.entities[] |
select(.id == "light.fixture_missing") |
.sourceName == "fixture missing" and
.name == "Porch" and
.state == "unavailable" and
.available == false and
.active == false and
.dimmable == false and
.brightnessPct == 0)
' <<<"$(qs ipc call home-assistant status)" >/dev/null \
|| fail 'missing Home selection was not retained as unavailable'
qs ipc call home-assistant fixture action-error >/dev/null
jq -e '
.fixture == true and
.phase == "ready" and
.stale == false and
.entityErrors["light.fixture_kitchen"] == "request-failed" and
(.entityErrors["light.fixture_hall"] // "") == "" and
.lastError == ""
' <<<"$(qs ipc call home-assistant status)" >/dev/null \
|| fail 'Home action error was not isolated to one entity'
qs ipc call home-assistant fixture stale >/dev/null
jq -e '
.fixture == true and
.phase == "degraded" and
.discoveredCount == 7 and
.configuredCount == 7 and
.visibleCount == 4 and
.stale == true and
@@ -81,6 +141,7 @@ qs ipc call home-assistant fixture unavailable >/dev/null
jq -e '
.fixture == true and
.phase == "unavailable" and
.discoveredCount == 0 and
.configuredCount == 0 and
.visibleCount == 0 and
.lastError == "not-configured"