Commit Graph

78 Commits

Author SHA1 Message Date
Gregg b64bd3a230 continued updates to captive access functionality 2020-09-02 21:10:56 -05:00
Gregg efe33fcdb9 Created captiveAccessURL()
Developing captive AP routines inside HAP.cpp
2020-09-01 22:08:51 -05:00
Gregg cd5b3115f5 Further updates to Captive AP Mode 2020-09-01 08:34:59 -05:00
Gregg 705a0922e1 Started work on CaptiveAP
Added span::config(hostName) to provide CaptiveAP at start-up.
2020-08-30 22:07:16 -05:00
Gregg 8c8168fe34 Update ZephyrHood3.ino
Switched pins for fan<->light
2020-08-26 17:45:00 -05:00
Gregg 30905c4ade Completed Zephyr3
Logic simplified and more robust, but brightness is NOT tracked.  Good compromise.
2020-08-24 12:15:03 -05:00
Gregg 7987cdaf48 FInal Version of Zephyr2
Includes abilty to change brightness of light through HomeKit as well as with button.  However, the vent light is too unstable to do this perfectly, and increasing brightness by stepping through multiple decreases is annoying.   To do:  Create Zephyr3 without brightness control and test to see how it works in practice.
2020-08-24 07:42:50 -05:00
Gregg e5fd2a200f Update DEV_Zephyr.h 2020-08-23 20:37:11 -05:00
Gregg 35280ccf53 Created Zephyr2
Create logic to track whether fan and light is on, withouth needing to rely on emulated pushbuttons.
2020-08-23 18:57:11 -05:00
Gregg 054d4dbf64 Completed Zephyr Vent Hood Example 2020-08-23 13:03:14 -05:00
Gregg 9f7e9a51e5 Created Zephyr Vent Hood Example 2020-08-23 08:21:56 -05:00
Gregg b42dd9dfba Implemented Reset Button
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.
2020-08-23 08:14:31 -05:00
Gregg 2172ac1ce6 Implemented Blinker statusLED
Replaced manual blinking with automated Blinker statusLED
2020-08-22 21:52:25 -05:00
Gregg 9952b48950 Created Blinker Class
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.
2020-08-22 13:22:19 -05:00
Gregg e298f32cbf Completed Example 15
All commentary finsihed.
2020-08-21 09:30:59 -05:00
Gregg f056b6ae82 Completed SpanButton()
And finished code for Example 15 to verify SpanButton() works as expected.  To Do: add comments and notes to Example 15.
2020-08-20 21:39:13 -05:00
Gregg c997ca3462 Created Example 15
Initial implementation of SpanButton PushButton object and check() logic
2020-08-20 07:29:15 -05:00
Gregg 9bbea69816 Re-organized Example Files into Tutorial Subfolders 2020-08-18 20:53:22 -05:00
Gregg 7fd21f2bed Completed Example 13
Fully documented Garage Door Opener and motorized Window Shade examples.
2020-08-18 20:36:40 -05:00
Gregg 6c5a5835e6 Eliminated TimedResets from Library
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.
2020-08-17 21:54:43 -05:00
Gregg 258882fe6d Renamed Example 14 to EmulatePushButton
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!
2020-08-17 21:42:58 -05:00
Gregg a905ac4ef3 Renumbered Examples
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.
2020-08-17 07:14:01 -05:00
Gregg d5ff5c506d Example 10NEW -> Example 14
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
2020-08-17 07:00:47 -05:00
Gregg 6e8e11b0b1 Created modified 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.
2020-08-16 22:00:13 -05:00
Gregg 9cecc0a31a Updated 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.
2020-08-16 21:46:58 -05:00
Gregg 1efeb2880b Created checkNotifications()
This will replace older checkEvents() after testing validates new and improved methodology.
2020-08-16 12:27:39 -05:00
Gregg 53f51cc11b Created new framework for Service loops()
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()
2020-08-16 08:45:24 -05:00
Gregg e3d1a9b566 Added Window Shade to Example 14 2020-08-14 18:44:45 -05:00
Gregg 0ade00eb9a Implemented checkTimedWrites()
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.
2020-08-14 17:46:35 -05:00
Gregg ffb7b7ed87 Updated putCharacteristics to use Timed Writes
Must next create small routine to clean up expire PIDs - something like: clearPIDs()
2020-08-14 09:59:48 -05:00
Gregg 8c888ff92a Created putPrepare()
Used unordered_map to store PID and TTL data.  Next step is to now read PID in updateCharacteristics() when needed.
2020-08-13 22:17:58 -05:00
Gregg 5da5bd31a1 Created Example 14
Ack!  Doors seem to need TIMED WRITES.  Must implement that next.
2020-08-13 18:27:43 -05:00
Gregg b529956b5f Completed Example 13
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.
2020-08-13 09:41:16 -05:00
Gregg 14bf85c7a1 More updates to Example 13 2020-08-13 06:19:18 -05:00
Gregg 7028fffaaf Updating Example 13 2020-08-12 22:00:50 -05:00
Gregg 56225b1018 updated Example 13
Moved "new SpanEvent" into DEV_Sensors.h and verified it works fine.
2020-08-11 21:55:49 -05:00
Gregg 698592b7a3 Updated checkTimedResets()
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.
2020-08-11 21:26:13 -05:00
Gregg 4f6f249357 completed update to checkEvent()
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.
2020-08-11 20:57:40 -05:00
Gregg 6ad063a2b2 Added AirQualitySensor
to use for development of multi-characteristic checkEvents()
2020-08-11 07:07:53 -05:00
Gregg 8d6db796cb Reworking checkEvents()
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.
2020-08-10 21:59:30 -05:00
Gregg 3a4be161e7 Update Services.h 2020-08-10 20:39:30 -05:00
Gregg 2e3daef92a Created Example 13
Created checkEvents(), which is a simplified (better) version of checkTimedResets().  To do:  re-write checkTimedResets() to mimic checkEvents();
2020-08-09 22:15:58 -05:00
Gregg e7c2fc46f7 Renamed SpanPut to SpanBuf 2020-08-09 20:33:15 -05:00
Gregg 471d62f3c2 created standalone eventNotify function
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.
2020-08-09 09:25:10 -05:00
Gregg d8a8eedad4 Completed Example 12
Demonstrates how to use ServiceType to set Primary Service as well as how to name individual Services.
2020-08-07 09:38:36 -05:00
Gregg 5a271dfc81 Updated Example 12 2020-08-06 22:55:02 -05:00
Gregg fff534b7cd Updated Example 12 2020-08-06 07:31:09 -05:00
Gregg fea694bd3f Created Example 12 2020-08-04 22:43:08 -05:00
Gregg f2a5e5e4f5 Re-worked Examples 5-10
Updated to reflect use of getVal(), getNewVal(), and updated(), intead of directly accessing the underlying member variables.
2020-08-04 21:58:57 -05:00
Gregg cf91f2c265 Tweaks to Example 11 2020-08-04 17:57:34 -05:00