4 Commits

Author SHA1 Message Date
DarkStarDS9 991cef1605 Fix: /homekit/accessories returns null when characteristic metadata contains NaN or Infinity (#2)
* Fix JSON encoding crash when HomeKit characteristic values are NaN or Infinity

JSONEncoder throws EncodingError.invalidValue for NaN/Infinity doubles, causing
the accessories endpoint to silently return null via try?. Map these to JSON null
instead so /homekit/accessories encodes correctly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* test: cover non-finite HomeKit numbers

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: Peter Steinberger <steipete@gmail.com>
2026-05-26 00:29:11 +01:00
Shadow 66d84d91c2 Fix scene selection state 2026-02-07 13:56:11 -06:00
Justin Ruckman bda9995ed8 Add HomeKit scenes support (list + execute via REST API)
- 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
2026-02-07 13:56:11 -06:00
Shadow 3ece0937a8 Squashed commit 2026-01-10 11:59:49 -06:00