This repository was archived by the owner on May 30, 2026. It is now read-only.
Add HomeKit scenes support (list & execute)#1
Merged
Conversation
- GET /homekit/scenes — list all scenes with id, name, homeId, type, isExecuting - POST /homekit/scenes/:id/execute — execute a scene by UUID Server: - HomeKitManager: scenes property, scene(with:) lookup, executeScene() async - HomeKitServer: route handling for GET and POST with homeKit-disabled guard - HomeKitPayload/HomeKitMapper: CasaScene model and JSON serialization UI: - Sidebar: new Scenes section with 'All scenes' + per-scene rows - Selecting a scene switches API docs to show scene-specific endpoints - Scene filter dropdown mirrors existing accessory filter for consistency - Accessory and scene selections are mutually exclusive
Member
|
Thanks for the contribution, ping me our Discord @4shadowed please! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds REST API endpoints and UI support for HomeKit scenes (action sets).
API Endpoints
GET /homekit/scenesLists all HomeKit scenes across all homes.
Response:
{ "ok": true, "data": [ { "id": "EF16B595-15F7-50D4-BECF-49DFEB28DE69", "name": "Dim Aoife's Room", "homeId": "9C4B0BB5-45DE-5DE0-89BE-CE81FEE471C8", "type": "com.apple.HMActionSetTypeUserDefined", "isExecuting": false } ] }POST /homekit/scenes/:id/executeExecutes a scene by UUID. Returns the scene name and execution status.
Response:
{ "ok": true, "data": { "name": "Dim Aoife's Room", "status": "executed" } }Errors:
404— Scene not found403— HomeKit module disabled500— Execution failed (with underlying error message)UI Changes
Files Changed
CasaModels.swiftCasaScenemodel structHomeKitManager.swiftscenesproperty,scene(with:)lookup,executeScene()async methodHomeKitServer.swiftContentView.swiftApiDocsView.swiftTesting
Tested locally with 42 HomeKit scenes. Scene listing returns all scenes across homes. Execute triggers the scene via
HMHome.executeActionSet()and returns within ~500ms.