Skip to content

feat: (CLI) pass --home through to home_id on hot-path commands - #115

Merged
omarshahine merged 1 commit into
omarshahine:mainfrom
visionik:feat/cli-home-on-hotpath
Sep 21, 2026
Merged

omarshahine merged 1 commit into
omarshahine:mainfrom
visionik:feat/cli-home-on-hotpath

Conversation

@visionik

@visionik visionik commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Summary

Day-to-day CLI commands (list / get / set / scenes / trigger / search / device-map) did not expose --home, even though the Unix socket already accepts home_id for those verbs. Manage/automations surfaces already had the flag. Multi-home setups had to flip config --default-home (or guess which home the active default pointed at).

This wires the same --home <name-or-uuid> option onto the hot-path commands and forwards it as home_id, matching get-scene and the structure/automations pattern.

Also updates README + OpenClaw HomeKit skill examples, and extends CommandParsingTests with per-command coverage plus a cross-command suite mirroring --home is honoured across structure commands.

Non-goals (follow-ups)

  • import-scene / update-scene / delete-scene / assign-rooms still send args["home"] (pre-existing; different socket shape) — not changed here.
  • status / events are not per-home on the socket today.
  • No App Store version bump (CLI-only surface; ships with the next app build that bundles the CLI).

Test plan

  • swift test — 188/188 green (includes new hot-path --home parse suite)
  • swift build --product homeclaw-cli -c release
  • Local multi-home smoke against a live HomeClaw socket:
    • list --home Tranquility --category lightbulb vs list --home Eastwind --category lightbulb (different counts)
    • Kitchen lights on/off at Tranquility and Eastwind via set … --home …
  • CI swift test on this PR

list/get/set/scenes/trigger/search/device-map already had socket
support for home_id; only manage/automations surfaces exposed --home.
Wire the same option on the day-to-day commands so multi-home agents
can target a home without flipping the configured default.

Also: parse-test parity (cross-command suite + nil defaults) and
README / OpenClaw skill examples for the new flags.
@visionik visionik changed the title CLI: pass --home through to home_id on hot-path commands feat: (CLI) pass --home through to home_id on hot-path commands Sep 7, 2026
@omarshahine
omarshahine merged commit de0c7bb into omarshahine:main Sep 21, 2026
4 checks passed
omarshahine added a commit that referenced this pull request Sep 21, 2026
* Reject unknown explicit homes instead of falling back to the primary

filteredHomes falls back to the primary home when an explicit home_id
matches nothing. With --home now on set/trigger (#115), a typo such as
`set "Kitchen Light" power true --home Cabni` would write to a same-named
accessory in the wrong home. The socket server now rejects any home_id /
home that names no known home with "Home not found: <id>", for every
command, before dispatch. UUID matching is also case-insensitive now.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* Validate explicit homes only after HomeKit is ready

Greptile: knowsHome let every home through while the home list was still
empty at startup, so an early `set --home <typo>` could resolve to the
primary-home fallback once HomeKit loaded. Wait for readiness first; every
command that takes a home already waits for it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Omar Shahine <10343873+omarshahine@users.noreply.github.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
@omarshahine omarshahine mentioned this pull request Sep 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants