Commit Graph

769 Commits

Author SHA1 Message Date
Gregg 03fcdac67e Merge branch 'dev' of https://github.com/HomeSpan/HomeSpan into dev 2021-03-21 22:37:41 -05:00
Gregg 8252c5390e Created ServoControl Example
Created in "Other Examples" and is based on Example 13 - WindowShade
2021-03-21 22:37:35 -05:00
HomeSpan bbf3650416
Update Extras.md 2021-03-21 22:34:05 -05:00
HomeSpan 2a4ebe9522
Update Tutorials.md 2021-03-21 18:26:12 -05:00
Gregg 54f7928204 Fixed bug in Example 13
WindowShade was incorrectly sending repeated event notifications to HomeKit!
2021-03-21 12:37:12 -05:00
Gregg 451a2885b1 Changed PwmPin to LedPin in all Tutorial Examples
Greatly simplifies use interface.  No need to specify or save channels.  And no need to even save pin number since that can be found using LedPin->getPin() method whenever needed.
2021-03-21 09:54:57 -05:00
Gregg d49bca9bbe Completed LedPin() and ServoPin()
Both classes check that total number of combined instantiations does not exceed 16.  ServoPin() has additional limit of only 8 instantiations.

DEPRECATED: PwmPin().  Keep for backwards compatibility only.
TO DO:  Update Tutorial Examples to replace PwmPin with LedPin, and update Extras.h documentations with LedPin and ServoPin.
2021-03-20 23:21:09 -05:00
Gregg a8dff0a7de Update PwmPin.cpp 2021-03-20 17:35:04 -05:00
Gregg 59e34fde05 Updated LedPin() 2021-03-20 17:19:47 -05:00
Gregg bc498c32e4 Created LedPin()
This is a replacement for PwmPin().   It keeps track of channel numbers internally, which greatly simplifies the user interface.  Starts by using the 8 Low Speed Timer channels and then moves to the 8 High Speed Timer channels if more than 8 LedPins are instantiated.  Throws a non-fatal error if more than 16 LedPins are instantiated, and ignores any attempts to set the duty cycle of those channels.
2021-03-20 17:14:19 -05:00
Gregg 65df97c563 Added ServoPin() class to PwmPin.h
Controls a 50-Hz servo motor using ESP32 built-in LED PWM.  Allows custom range for microseconds and degrees.
2021-03-20 12:20:43 -05:00
Gregg 61655845a9 Updated PWM
Removed need to include channel number in set() method.  Why was this ever there?  Need to update Examples and PwmPin docs.  But keep stub method that includes channel for backwards compatibility.
2021-03-19 06:38:41 -05:00
HomeSpan 6aba1a28e5
Merge pull request #63 from HomeSpan/release-1.2.1
Release 1.2.1
2021-03-13 07:29:59 -06:00
HomeSpan 01ae18e133
Update README.md 2021-03-13 07:23:39 -06:00
HomeSpan 6df48a32dd
Update README.md 2021-03-13 07:22:58 -06:00
HomeSpan 48127a3380
Update Reference.md 2021-03-13 07:03:18 -06:00
Gregg b90f173a6f Set version number to 1.2.1 in preparation for release 2021-03-13 06:31:18 -06:00
Gregg a89ddf3748 Updated Example 13 - Window Shade to show proper use of Characteristic Current Position
Also added discussion of why Characteristic Position State is not needed even though it is required.
2021-03-12 09:45:50 -06:00
Gregg 16aff0e855 Updated formatting of Accessory Database output to Serial Monitor
Used unicode arrows and symbols, and included more detailed information about each Service and Characteristic.
2021-03-10 22:44:59 -06:00
Gregg d2a7030640 Reclaimed memory from REQ and OPT vectors after they are no longer needed.
Lots more memory optimization to perform!
2021-03-09 21:47:52 -06:00
Gregg 8121146c6b Changed ERROR to WARNING when a required Characteristic is missing
Only throw a non-fatal warning instead of a fatal error if a Service is missing a required Characteristic.  This allows for user flexibility in leaving out required Characteristics for Services that don't seem to need them (contrary to the HAP docs).

Also, changed PositionState Characteristic back to Required (instead of Optional) in WindowCovering Service (as specified by HAP).  If PositionState is not included this will only throw an error instead of a warning as a result of the above change.

To Do: Update Example 13 to properly incorporate PositionState Characteristic.
2021-03-09 20:33:54 -06:00
HomeSpan da74066c70
Update Reference.md 2021-03-09 08:25:13 -06:00
HomeSpan a0e220356d
Update ServiceList.md 2021-03-09 08:08:39 -06:00
HomeSpan c6946891bb
Update Tutorials.md 2021-03-09 08:03:06 -06:00
HomeSpan c64c31f4cf
Update Reference.md 2021-03-07 17:41:41 -06:00
Gregg bcbe4c1d92 Merge branch 'dev-1.2.1' of https://github.com/HomeSpan/HomeSpan into dev-1.2.1 2021-03-07 17:39:44 -06:00
Gregg 53268127be Updated Examples to use `setRange()` instead of `new SpanRange()`
setRange() is preferred method.  SpanRange() is legacy only
2021-03-07 17:39:42 -06:00
HomeSpan 209836c170
Update Reference.md 2021-03-07 08:52:18 -06:00
HomeSpan 9e124ab771
Update Reference.md 2021-03-07 08:46:46 -06:00
HomeSpan 2f8cd511dd
Update Reference.md 2021-03-07 08:45:24 -06:00
Gregg ff0dfefc47 Added check to ensure initial value of Characteristic is in allowable Range
Check is not applied to STRING Characteristics.  Check is performed at end of each Accessory definition so will account for any changes to min/max as a result of calls to setRange().  If initial value is outside allowable range, a WARNING (not an ERROR) is thrown.
2021-03-06 09:08:57 -06:00
Gregg 3b40aeec74 Added check to throw error is setRange is called twice on same Characteristic 2021-03-06 08:30:09 -06:00
Gregg 7e3d982ee5 Added min/max Range defaults for all Characteristics
Also added new flag "staticRange" for all Characteristics that indicates whether the min/max range can be changed.  An ERROR will be thrown if setRange is attempted for a Characteristic having staticRange=true.
2021-03-05 22:34:55 -06:00
Gregg 26a38b68cc Completed full implementation of setRange() and deprecation of SpanRange()
Next TO DO:  Complete entry of default min/max into all Characteristics (except BOOL and STRING) defined Span.h so that setRange() error checking works for all Characteristics.
2021-03-04 07:18:13 -06:00
Gregg 5c5361be7b Moved UVal back into SpanCharacteristics 2021-03-03 19:53:13 -06:00
Gregg 5ca0bdc907 Added error checks to setVal()
Warning will be thrown if setVal() request is outside of mix/max range for the Characteristic, though min/max range not yet modified by SpanRange().

TO DO:  Create new Characteristic methods setRange(typename T_MIN, typename T_MAX) and setRange(typename T_MIN, typename T_MAX, typename T_STEP) that will reset min/max, or min/max/step, and trigger required output in database.  Add in checks to ensure setRange is NOT used to STRING or BOOLEAN.  Also add check to ensure STEP is always>0.  Add new UVAL for STEP that is normally zero, which indicates NO step size has been set (and does not need to be reported to database).   Then, set warnings about SpanRange being deprecated at some point in the future.
2021-03-01 09:09:24 -06:00
Gregg c8a2770253 Renamed Services.h to Span.h
Also, made it possible to use UVAL.set() for STRING Characteristic (upon initialization) but setVal() is NOT allowed.
2021-02-28 17:48:34 -06:00
Gregg 7930e3a0d9 Re-Factored SpanCharacteristic Constructor and Services.h
Added Characteristics.h file that defines all static data for HAP Characteristics.  Changed macros in Services.h to use this new HapChar structure.

Code is now more streamlined and ready for mix/max range-checking to be added.
2021-02-28 10:49:17 -06:00
Gregg 064d881e9c Refactored getVal() and getNewVal()
Functionality is identical, but template has been moved into UVal structure along with setVal, which simplifies code and allows for other uses if needed.
2021-02-27 12:54:32 -06:00
Gregg f591735deb Refactored setVal() to use a template
Ensures robustness and is fully backwards compatible.  User does NOT have to specify a template parameter, as the compiler determines this from the setVal() argument itself.  Allows for any numeric type to be properly mapped to correct HAP format for the Characteristic.

This change is also needed to prepare for the refactoring of SpanRange, the addition of UVals to store HAP min/max, and new error-checking of min/max limits within setVal.
2021-02-27 12:36:50 -06:00
Gregg 433e1cd59a Updated setVal() logic
Updated setVal() logic to ensure that every possible combination of parameter type and Characteristic type is handled properly, and without generating a compile-time error related to ambiguous parameters.
2021-02-26 07:53:33 -06:00
HomeSpan f536db83aa
Update FAQ.md 2021-02-23 19:35:38 -06:00
HomeSpan ab25f55645
Update FAQ.md 2021-02-23 19:34:51 -06:00
Gregg 6f589af43a Update DEV_Sensors.h 2021-02-23 09:56:45 -06:00
Gregg 396e3322a9 Update DEV_Sensors.h 2021-02-23 06:43:41 -06:00
Gregg 3edc30222f Updated Example 12 to demonstrate negative temperatures
Use SpanRange() to change HAP default range of 0-100 to -50 to 100.  Change starting temp +30 and have it reset to -30 after hitting +35.
2021-02-22 20:27:42 -06:00
Gregg b2790386d6 Update Services.h
HAP documentation is INCORRECT!  Actual range for ColorTemperature is 140-500.  Change default to 200.
2021-02-20 15:43:35 -06:00
HomeSpan 2be0a2cea1
Update README.md 2021-02-19 18:14:33 -06:00
HomeSpan cb677eb69d
Update FAQ.md 2021-02-19 18:13:57 -06:00
HomeSpan d16c7fe2f5
Update OTA.md 2021-02-19 18:13:30 -06:00