Repository navigation
Conversation
Add the eight services and 27 characteristics of Apple's HomeKit Secure Video Open Source Compatibility Guide (Developer Preview 1.0) to the loader resources. Two of them, Contributing Sensors and Motion Enabled, also become optional characteristics of the Motion Sensor service. Timed write is advertised where the guide requires it. Writes to Motion Enabled and Streaming Enabled are marked admin only with an "AdminOnlyAccess": ["write"] catalog property. It is not part of the HAP representation and not enforced yet. Camera Recording Management keeps the characteristics classic recording relies on.
Third Party Camera Active is state the camera reports, so controllers read and subscribe to it but do not write it. Night Vision and Camera Operating Mode Indicator are written with timed writes. The Camera Global Operating Mode service of HKSV 17.99 uses all three. This matches the definitions in HAP-NodeJS.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #531 +/- ##
=======================================
Coverage 90.38% 90.38%
=======================================
Files 26 26
Lines 3796 3796
Branches 458 458
=======================================
Hits 3431 3431
Misses 258 258
Partials 107 107 🚀 New features to boost your workflow:
|
This was referenced Nov 8, 2026
ikalchev
added a commit
that referenced
this pull request
Nov 10, 2026
* Rewrite gen_hap_types.py to use macOS HomeKitDaemon metadata Regenerates the characteristics/services catalog from Apple's plain-metadata.config (ships with macOS, updated with every OS release) instead of the Xcode HomeKit Accessory Simulator plist, which lags far behind (163 chars / 48 services vs 242 / 69). Mirrors the approach of HAP-NodeJS's generate-definitions.ts: - plain-metadata.config is the primary source (no Xcode required) - the simulator plist is used as an optional overlay (richer permission strings, ValidValues constraints) when installed - scripts/hap_manual_overrides.json holds hand-maintained additions and overrides for things not yet in Apple's machine-readable metadata (seeded with the HKSV 17.99 definitions, incl. the PR #531 content) - names and required/optional lists are stable across regenerations: UUID-based name resolution plus inheritance rules prevent Apple's description drift and required->optional demotions from breaking existing accessories; ValidValues suppress numeric min/max so invalid values are rejected instead of silently clamped - dry-run by default with an add/remove/change report; --write to apply The regenerated catalogs add 108 characteristics and 30 services (AccessCode, Thread, Siri, WebRTC/HKSV 17.99, power management, etc.). * gen_hap_types: require simulator plist, add --allow-missing-simulator Error out when the HomeKit Accessory Simulator plist is missing instead of silently degrading: without the overlay, ValidValues for newly added characteristics would be missing and permissions fall back to the coarser bitmask. --allow-missing-simulator proceeds explicitly with a loud warning; existing characteristics remain covered by field inheritance. * loudly fail if simulator is missing * gen_hap_types: simulator plist contributes ValidValues only The Additional Tools simulator plist turned out to work differently from the old Xcode-bundled one: its Permissions list holds auth flags (securedRead/securedWrite) and the read/write/notify strings live in Properties - so mapping Permissions to pr/pw/ev emptied every permission list, and the plist no longer carries numeric constraints either. Mirror HAP-NodeJS's generator: permissions and min/max/step come exclusively from plain-metadata.config; the simulator plist is used only for enumerated ValidValues ({value: state} reversed to {state: value}), falling back to inheritance from the previous catalog per characteristic. Also autodetect the simulator at both install locations (with and without the Xcode nested Applications folder). * Mirror HAP-NodeJS's corrections of Apple metadata quirks Diffing the regenerated catalog against HAP-NodeJS's generated definitions (V=889) surfaced deliberate fixes they carry in their CharacteristicOverriding config, which our catalog needs too: - WRITE_RESPONSE on the five control-point characteristics (AccessCodeControlPoint, NFCAccessControlPoint, TransitionControl, DataStreamHAPTransport, SetupDataStreamTransport) - uint8 format for HomeKitCameraActive/EventSnapshotsActive/ PeriodicSnapshotsActive - the HKSV 17.99 guide and HAP-NodeJS both define them as uint8 while plain-metadata.config says bool - CurrentTemperature minValue -270 (spec minimum; metadata says 0 which clamps negative readings to 0) - LockLastKnownAction values 9/10 from the newer HAP spec Also regenerated with the simulator plist overlay now active. * gen_hap_types: refresh docstrings for the ValidValues-only overlay - the simulator overlay now contributes ValidValues only (permissions always come from the plain-metadata bitmask), so drop the stale 'coarser bitmask fallback' wording - field inheritance applies per characteristic, not only when the simulator is missing entirely - document the three stability rules (UUID-based naming, required/optional service inheritance, ValidValues suppressing min/max) and the metadata corrections carried in characteristicOverrides * Type-annotate gen_hap_types.py and bring it under ruff and ty Add full type annotations (catalog/entry/Apple-metadata aliases) to the generator and bring it into the lint scope: - tox.ini: ruff check/format now also cover scripts/gen_hap_types.py (scripts/pickle_to_state.py keeps its pre-existing violations and stays out of scope) - pyproject.toml: add "scripts" to [tool.ty.src] Fixes surfaced by the tools: import sorting, long docstring/signature lines, an overwritten loop variable in the ValidValues conversion, an unused loop variable, and the untyped "_slug_to_name" hack - the slug -> name table is now passed as a separate, properly typed parameter. Generator output is unchanged (dry run reports 0/0/0).
Owner
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Adds the 8 services and 27 characteristics from Apple's HomeKit Secure Video Open Source Compatibility Guide (Developer Preview 1.0) to
services.json/characteristics.json. Two of them, Contributing Sensors and Motion Enabled, also become optional on Motion Sensor. Admin-only writes are stored as"AdminOnlyAccess": ["write"]like HAP-NodeJS; not sent to controllers and not enforced yet.Second commit fixes perms on three existing characteristics to match the guide and HAP-NodeJS: Third Party Camera Active is read/notify only, Night Vision and Camera Operating Mode Indicator get
tw. pyhap'sCameradoesn't use these three; accessories that add them now advertise the new perms.Tests pin every entry to the guide's tables.
References: