Commit Graph

5 Commits

Author SHA1 Message Date
Gregg f322f2b0f1 Updated Examples 14-17 2022-04-10 16:04:36 -05:00
Gregg b6c5a6b68d Added License Info to all files 2020-11-02 20:09:09 -06:00
Gregg d45f210c5b Completed comments for Example 16 and confirmed all functionality. 2020-11-01 21:10:35 -06:00
Gregg f0f761c143 Extended Exmaple 16 to use two Stateless Programmable Switches
Added ServiceLabelIndex Characteristic, which seems to be required as noted in HAP specifications.  However, linking to a ServiceLabel Service does not appear to be required, so there is no need to build any Service-Linking logic into homeSpan - will wait for use-case to be identified.

To do:  Add support for double-click to SpanButton, then include in Example 16.
2020-10-31 15:53:06 -05:00
Gregg 3979498b3c Created Example 16 - Programmable Pushbutton
Modified SpanCharacteristic::sprintfAttributes to streamline logic and add special handling for the ProgrammableSwitchEvent Characteristic as required by HAP:  the value returned for the database or any read request must be set to null (i.e. "value":null).  The only time the real value should be returned is when the device sends a EV/Notify message (when the button is pressed).  Verified that the example works as expected!

TO DO:  Add functionality to allow for Service Namespace and Index label so that you can have multiple programmable pushbuttons in one service - this requires logic for HAP LINKED SERVICE functionality.
2020-10-31 09:35:42 -05:00