Allows for reset of HAP (press for 5 seconds, but less than 10) or Factory reset (press for 10 second). Use setResetPin to change from default of pint 21.
Generic blinking class for LEDs that uses Alarm Timer interrupts that work in background. Will be used to replace and extend HAP blinking of Builtin_LED to convey status of HomeSpan at varioud points in the code.
This is no longer needed since PushButtons can be easily emulated from within a Service loop() as per Example 14. Library is now fully up-to-date: TimedResets and SpanEvents have been fully removed.
AND updated Example 13 to reflect new loop() framework in place of SpanEvents. ALSO found a bunch of inconsistencies with WindowCovering HAP documentation. PositonState and HoldPosition are NOT used by HomeKit. However, HomeKit has a full slider for controlling shades which makes a Hold Button no longer needed. See Example 13 for details. Open to do: add commentary to Example 13 and eliminate SpanEvents from library!
Renumbered Example 11 (RGB_LED) to Example 10; Example 12 (ServiceOptions) to Example 11; Example 13 (ServiceLoops) to Example 12; and Example 14 (TargetStates) to Example 13. Example 14 is now the PushButton example (previously the TimedReset Example).
To do: Must update Door and Window code in Example 13 (TargetStates) to utilize new loop() framework. Must also delete all references to TimedResets in library code.
Updated Example 10NEW to fully reflect the use of loop() methods instead of TimedResets to emulate a push button. Renamed Example 10 to Example 14, since it must come after we introduce loops(). Deleted both original Example 10 and Example 10NEW
This uses loop() method to auto-reset the blinking LED controller after 3 seconds instead of requiring the use of a TimedReset object. To do: eliminate all TimedReset code as it is no longer needed. Will also need to renumber examples, since new Example 10 uses loop() which is not introduced until after current Example 13.
Completed new framework for using loop() methods and deleted all code related to new SpanEvent() and event() loops. Re-worked Example 13 to utilize new framework and validated it functions as expected.
Service loops() called for only those Services with over-ridden loop() methods. TO DO: update event logic to follow new framework. Vector should point to all CHARACTERISTICS that are updated to setVal()
This check all timed write PID/TTL entries and clears all those that are expired. This completes the implementation of Timed Write functionality as required for PUT /prepare requests.
Added detailed notes section to further explain all processes related to Event Notifications. Foreshadowed next example, which will be a Service supporting current and target state characteristics.
converted checkedTimeResets() from two-pass logic that first computes the required size of SpanBuf to a single-pass that utilizes vector<SpanBuf> instead. Much cleaner and easier.
checkEvents() now allows for multiple characteristics to be updated by service->notify(). This change included the use of vector<SpanBuf> to dynamically create the the temporary storage needed. To do: re-work similar routines to use vector<SpanBuf> instead of needing to perform two passes each time to gauge size of SpanBuf array needed.
creating code to allow for multiple characteristics to be updated within event() call. To Do: define anogther sensor that supports multiple characteristics. also need to check that "new SpanEvent" works as expected from within a defined service.
putCharacteristics and checkNotifications now both call the same eventNotify routing. This is being done to prepare for services that will stream notifications back to client (like a temperature sensor, or pushbutton). TO DO: rename checkNotifications to check TimedResets, and rename SpanPut to something more generic.
Transtioned to all getter methods: getVal(), getNewVal(), updated(), using templates for all floats.
Finalized templates for getVal and getNewVal, including making <int> default so it does not have to be set for most getVal() and getNewVal() calls. Works for booleans as well. TO DO: Re-work and check ALL prior examples to ensure they use getVal, etc., and DON'T access value, newValue, isUpdated, directly.