Commit Graph

1696 Commits

Author SHA1 Message Date
Gregg f3b1de2f6b Changed apConfig() to use fixed SSID of "HomeSpan-Configuration" 2020-10-12 07:55:07 -05:00
Gregg 8cfd9afa63 Minor tweaks to some LED patterns 2020-10-11 19:18:22 -05:00
Gregg e658d6d4eb Tweaks to blinker() to make sure delayTime ADDs to offTime 2020-10-10 16:40:53 -05:00
Gregg a6d9fa86e2 Update HomeSpan.cpp 2020-10-10 16:19:58 -05:00
Gregg 3872d693a5 Updated Command Mode to include timeout and for apConfigure() to have more cancel options 2020-10-10 08:22:02 -05:00
Gregg 7e4df498db Completed integration of apConfigure()
The 'A' command now resets any existing WiFi functionality so that it can start an Access Point without needing to first reboot.

To Do:  Add a method to cancel out of apConfigure() and reboot by pressing control button.

To Do:  Create time-out for commandMode()
2020-10-09 07:57:30 -05:00
Gregg 5cb09b6ad8 Updated Access Point code 2020-10-08 21:06:05 -05:00
Gregg 206d194cc1 Created commandMode()
Universal command mode for control button operation.
2020-10-07 22:20:44 -05:00
Gregg a4b86f4618 Re-worked network.serialConfigure() and initWifi()
To do:  Re-work apConfigure() and update factory reset so that it only deletes HAP and WIFI data, NOT setup code.
2020-10-07 08:20:37 -05:00
Gregg cf0627e8c9 Updating WiFi Configuration Logic
Changing code so that it is possible to run HomeSpan without configuring WiFi.  HomeSpan can already run without being paired, but requires WiFi at start-up.  No reason to force WiFi to be used if device has buttons to operate the appliance withouth the need for WiFi or a connection to HomeKit.  Work in progress...
2020-10-06 09:09:43 -05:00
Gregg c30b75280a Update .gitignore 2020-10-05 21:34:37 -05:00
Gregg d3029af569 Delete extras.ino 2020-10-05 21:33:55 -05:00
Gregg 598f1861ac Update library.properties 2020-10-05 21:30:40 -05:00
Gregg b1e8f9e8f2 Update HAP.cpp 2020-10-05 07:48:54 -05:00
Gregg 8b1ea2a70e Updating .gitignore 2020-10-05 07:44:59 -05:00
Gregg 19829c8c6b Fixed typo. 2020-10-05 07:40:04 -05:00
Gregg 74432dd24a Create .gitignore 2020-10-05 07:37:23 -05:00
Gregg 7548ddd79e Update RFControl.h 2020-10-04 13:54:57 -05:00
Gregg 0d9b7e3c16 Made RFControl more generic
Instead of pre-defining RF433 and RF315, the user should define their own RFControl{pin} as a variable in their device-specific DEV_*.h file.  Makes RFControl more generic and not specific to any transmitter name (such as 433 or 315).  Also means that the pin can be set by the user instead of having to modify RFControl.h deep in the library.
2020-10-04 13:53:07 -05:00
Gregg 22962ebfe3 Moved Zephyr into a standalone repository; Re-organized tutorials
Zephyr3, the latest version, was moved into its own repo and renamed ZephyrVentHood.

Deleted Zephyr1, Zephyr2, and Zephyr3, which are no longer needed.

Flattened folder structure for Examples and placed them all in top-level directory
2020-10-04 11:00:08 -05:00
Gregg 65ce2d57aa Create LICENSE 2020-10-04 10:29:24 -05:00
Gregg 82215e8d90 Modified SpanService to accept list of required and optional SpanCharacteristics
Started adding lists to the first few Services in Service.h.  This is a longer-term project to enable HomeSpan to validate a configuration and check that all Services have all required Characteristics and that any optional Characteristics defined are indeed permitted.
2020-10-04 09:58:40 -05:00
Gregg 855d5e9735 Added Error messages and Warnings for SpanRange and SpanButton 2020-10-04 09:26:21 -05:00
Gregg db620e497e Added code to output configuration log and error messages
Config Log is output if logLevel>1 OR there is a fatal error in configuration
2020-10-03 22:21:38 -05:00
Gregg 1d6f07a400 Added HAP Names to all Services and Characteristics in Services.h 2020-10-03 21:39:20 -05:00
Gregg 60c2d5645d Update HomeSpan.cpp
Tweaks to WiFi reset code so that instead of re-starting, HomeSpan simply disconnects WiFi, which triggers initWifi() upon the next call to poll(().
2020-10-03 20:18:58 -05:00
Gregg b06dadc6a1 Updated commentary in Example 15 to reflect new logic for LONG presses
Changed commentary to explain that Long Presses do NOT need to have the button released, AND a LONG press will repeat if the button is held.
2020-10-03 19:33:01 -05:00
Gregg 546c5048db Fixed bug in initialization logic at beginning of poll()
Full initialization now depends on "isInitialized" flag instead of monitoring Wifi connection, to protect against a loss of WiFi causing a re-initialization, instead of just a wifi reconnect with initWifi() alone.
2020-10-03 15:08:44 -05:00
Gregg 7ecff55f9c Updated PushButton() so that longPresses always repeat
No need for any new methods - default is now that longPress repeats every longTime milliseconds provided button continues to be held down.  Once a longPress is triggered, a shortPress will not be triggered until button is released.
2020-10-03 12:02:57 -05:00
Gregg 77c48dcf46 Updated SpanButton to use Utils::PushButton
SpanButton now instantiates PushButton instead of keeping track of its own triggering logic.  This means that SpanButton longPress() is triggered by holding down the button for longTime WITHOUT the need to release.  This is a desired change.

Next:  Must update Example 15 to state that SpanButtons trigger a long press withouth needing to be released.

To do:  Consider adding a "repeating mode" for longPress in which the SpanButton re-triggers every longTime while button continues to be pressed.  Best way to implement is probably by creating a PushButton::extend() method.
2020-10-03 10:45:01 -05:00
Gregg e350aa6723 Update Settings.h 2020-10-03 09:37:21 -05:00
Gregg 0bdeb7508d Created #defines in Settings.h for all statusLED.start() commands
Reviewed and simplified the number of different blinking patterns.  All are now labeled in Settings.h
2020-10-03 09:36:01 -05:00
Gregg 0a5cf52569 Modified Service::update() to return boolean instead of StatusCode
Also moved StatusCode definitions from Settings.h to HAPConstants.h.  There was no reason to have the user return a StatusCode of OK or UNABLE from update() since the only other choice was BUSY and HomeKit does not seem to distinguish errors.  Either it's okay or not okay, which can more easily be represented by a simply return of TRUE or FALSE from update().

The user now needs to know nothing about StatusCodes.   All Examples were modified to change StatusCode update() to boolean update() and return(StatusCode:OK) to return (true).

Much simpler.
2020-10-01 21:41:26 -05:00
Gregg fbd33bb29d Created homeSpan::setMaxConnections() to make number of HAP connections dynamic
This completes all changes to Settings.h.  User will not need to ever access this files or change any settings.
2020-09-30 10:00:10 -05:00
Gregg c51396a170 Moved MAX_SSID and MAX_PWD from Settings.h to Network.h 2020-09-30 07:24:15 -05:00
Gregg ba66c6f01a Normalized all #includes
Convention is that every *.cpp references, in this order:

1) Any required core librries
2) Its own *.h  (i.e. Foo.cpp -> Foo.h)
3) All other *.h files needed by the cpp, UNLESS those *.h files are already in its own *.h file.  Must include all *.h files that are not in its own *.h file even if it is others that are referenced.
2020-09-29 07:28:27 -05:00
Gregg 606601f447 Add 'L' command to change Log Level 2020-09-28 19:59:03 -05:00
Gregg 301c7dc652 Updated Example 9
Change VERBOSITY to new setLogLevel() framework.
2020-09-28 18:47:09 -05:00
Gregg dee954d5bd Converted VERBOSE macros to LogLevel macros that use real-time if-statements.
This change allows the user to set the log-level with homeSpan.setLogLevel() instead of needing to change in Settings.h.  Next up:  Update Example that introduces VERBOSE to instead use setLogLevel().  Consider adding an interactive 'L' command to change this during run-time.

Also, added "#pragma once" to every *.h file to prevent duplication of definitions.  TO DO:  Review all #include to ensure sanity across all files.
2020-09-28 18:04:59 -05:00
Gregg 381b25860a Moved default parameters for homeSpan.begin() to Settings.h 2020-09-27 22:52:03 -05:00
Gregg 2d8f36e735 Created HomeSpan::setApPassword() and setAPTimeout()
Moved default values into Settings.h
2020-09-27 22:31:11 -05:00
Gregg 7d8a91f13b Updated prior Examples and eliminated ServiceType 2020-09-27 17:42:56 -05:00
Gregg fa8c5934ea Eliminated ServiceType from Library and Example 11
Next up - update Examples 12+ to delete ServiceType
2020-09-27 15:56:48 -05:00
Gregg 814d751e71 Created SpanService::setPrimary() and setHidden()
These optional methods can be "chained" when instantiating a new SpanService to configure the Service as Primary or Hidden (or both).  This alleviates the need to ServiceType to be propogated through the Service constructor.

Next Up:  Eliminate ServiceType construct and update Examples to use setPrimary instead.
2020-09-27 14:51:31 -05:00
Gregg 538a3a9531 Added PushButton::primed()
Allows you to determine if short-press has occured but button not yet released.
2020-09-27 14:33:38 -05:00
Gregg a40447b8f8 Created methods to set Control and Status Pins
Created separate init() methods for PushButton and Blinker.  Created HomeSpan:setControlPin and HomeSpan:setStatusPin that can be called from main setup() to modify the defaults.  All default settings being migrated to Settings.h
2020-09-27 13:41:02 -05:00
Gregg ac25b94b67 Fully implemented Generic PushButton
Generic PushButton now used for all device control functions.
2020-09-26 17:13:17 -05:00
Gregg b7de0cf710 Created Generic PushButton
Wll be used for control button.  Nothing to do with buttons that control Accessories, which are handled by SpanButton.
2020-09-26 16:23:44 -05:00
Gregg 6a2d0741aa Finished 'U' unparing routines
Next Up:  Add method to break out of WiFi connection loop by using push button in case WiFi SSID/PWD has changed but there is no desire to unpair controllers.  To Do:  Move blinking status light setting to named macros.
2020-09-24 09:29:52 -05:00
Gregg 69c7d939b8 Update HomeSpan.cpp
Setup Code now saved after serialConfig() or apConfig().

Next up: Create 'U' command to unpair controller.  Change function of control button so it unpairs (short press) or resets WiFi (long press).

To do:  Revisit statusLED blinking paterns to make sure they are clear and consistent - save them as macros in settings.h
2020-09-23 08:51:13 -05:00