Repository navigation
Conversation
Add StatefulProgrammableSwitchAccessory, StatefulProgrammableSwitchService (0x88) and ProgrammableSwitchOutputStateCharacteristic (0x74, uint8, 0..1, pr/pw/ev). The service is not in the public HAP specification; the definitions follow HAP-NodeJS. Purely additive: no existing class changes.
yfre
force-pushed
the
feature/161-stateful-programmable-switch
branch
from
October 18, 2026 21:19
4b3a94c to
62077b7
Compare
This was referenced Oct 18, 2026
Member
|
I'll admit I'm still cloudy on how this is even intended to be used. At the least I'd like to see a comment linking to https://developer.apple.com/documentation/homekit/hmservicetypestatefulprogrammableswitch showing it's a real thing, even if it is poorly documented. |
Contributor
Author
|
@ccutrer i was also thinking about it yesterday. i tend to drop this PR as there is not use for it. i just had on the list of accessories which HAP supports.. but again, unclear how to use it. i will drop this PR. |
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.
Closes #161
What
Adds support for the Stateful Programmable Switch service:
StatefulProgrammableSwitchAccessorygetServices()StatefulProgrammableSwitchService0000008873), Programmable Switch Output State (74); optional: Name (if the accessory implementsAccessoryWithName)ProgrammableSwitchOutputStateCharacteristic00000074uint8, 0–1, step 1, permspr/pw/evThis service isn't in Apple's public HAP specification or the HomeKit ADK. The definitions follow HAP-NodeJS, as the issue suggests.
ProgrammableSwitchOutputStateCharacteristicuses theIntegerCharacteristicformat constructor from #203 to advertiseuint8.Compatibility
Purely additive: three new classes and no changes to existing classes. Behavior is unchanged for existing accessories, including openHAB setups.
Caveat
Reports from the homebridge community suggest the Apple Home app doesn't display stateful programmable switches; third-party HomeKit apps can use them. I haven't verified this on a device. Library users get the API either way, but end users may only see it in third-party apps.
Testing
mvn -B packageon JDK 11: all 28 tests pass. The newStatefulProgrammableSwitchServiceTestcovers:88and the required characteristic order (73,74), plus Name whenAccessoryWithNameis implementedgetServices()returning the stateful switch serviceuint8,pr/pw/ev, min 0, max 1, minStep 1, no unitsetSwitchOutputState, and subscribe/unsubscribe delegation🤖 Generated with Claude Code