Commit Graph

10 Commits

Author SHA1 Message Date
Gregg cf2a98d1c2 Review and refresh comment in Tutorial Examples as needed.
Also introduced the use of Enumerated Constants in Example 13 - Target States
2024-03-09 19:00:05 -06:00
Gregg f322f2b0f1 Updated Examples 14-17 2022-04-10 16:04:36 -05:00
Gregg b8d4940772 Removed use of LED_BUILTIN in library and all examples
LED_BUILTIN is NOT defined for all ESP32 boards - some do not have a built-in LED!  Instead, Status LED now defaults to Pin 13, as opposed to LED_BUILTIN.  Also, added a new method, homeSpan.getStatusPin(), to return the pin number used for the Status LED, whether or not it remains the default (13) or is changed by user with homeSpan.setStatusPin(pin).  This method is now used in the DEV_Identify.h file for each example, instead of using LED_BUILTIN (which otherwise won't compile for boards without a built-in LED)
2021-01-09 12:51:35 -06:00
Gregg 69057d560a Converted `char *` to `const char *` in DEV_Identify() 2020-12-27 09:38:12 -06: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 c153824b95 Updated SpanButton Examples
And re-worked the logic in Example 15 to make full use of DOUBLE press functionality.  To Do:  Add commentary to Example 16.
2020-11-01 15:22:16 -06:00
Gregg e2f11630fa Updated SpanButtton to recognize new Double Press event
button(int pin, boolean isLong) changed to button(int pin, int pressType), where pressType can be SpanButton::LONG, SpanButton::SINGLE, or SpanButton::DOUBLE.  Updated Example 16 and confirmed everything works as expected.

To do: Review all prior examples and update SpanButton when needed.  Also need to update Zephyr Vent Hood code!
2020-11-01 12:21:34 -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