Commit Graph

1034 Commits

Author SHA1 Message Date
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
HomeSpan b373291dcb
Update GettingStarted.md 2021-02-19 18:11:37 -06:00
HomeSpan 05c4e81fa2
Update GettingStarted.md 2021-02-19 18:07:31 -06:00
HomeSpan 14a8848436
Update README.md 2021-02-19 18:04:59 -06:00
HomeSpan 4c632369b3
Update FAQ.md 2021-02-19 18:03:27 -06:00
HomeSpan 0d28eaa216
Update FAQ.md 2021-02-19 18:01:57 -06:00
HomeSpan bcac669b40
Update FAQ.md 2021-02-19 17:56:07 -06:00
HomeSpan e175ba1527
Update FAQ.md 2021-02-19 17:55:02 -06:00
HomeSpan a3832d5765
Update FAQ.md 2021-02-19 17:49:56 -06:00
HomeSpan f0fee53d81
Update FAQ.md 2021-02-19 17:46:46 -06:00
HomeSpan bdcc4eab6f
Update FAQ.md 2021-02-19 07:58:22 -06:00
HomeSpan e20ae3a975
Update FAQ.md 2021-02-19 07:45:52 -06:00
HomeSpan 0ff4a222ab
Create FAQ.md 2021-02-19 07:00:53 -06:00
HomeSpan 6ff15e9b9e
Merge pull request #45 from HomeSpan/release-1.2.0
Release 1.2.0
2021-02-18 21:37:00 -06:00
HomeSpan b666fe7c69
Update README.md 2021-02-18 21:34:34 -06:00
HomeSpan dd4f8f34f8
Update README.md 2021-02-18 21:31:57 -06:00
Gregg c7447b061c Set Version to 1.2.0 2021-02-18 21:09:28 -06:00
Gregg 77a4882527 Merge branch 'dev1.1.5' of https://github.com/HomeSpan/HomeSpan into dev1.1.5 2021-02-18 21:02:49 -06:00
Gregg 96d3877ef6 Added check to ensure HostName is valid
Must be 255 or less alphanumeric characters or a hyphen, except hyphen can't be first or last character.
2021-02-18 21:02:41 -06:00
HomeSpan b1a0b32b3b
Update OTA.md 2021-02-18 20:57:49 -06:00
Gregg 3bd615bc8b Merge branch 'dev1.1.5' of https://github.com/HomeSpan/HomeSpan into dev1.1.5 2021-02-18 18:20:36 -06:00
HomeSpan e0b9958001
Update OTA.md 2021-02-18 07:28:14 -06:00
Gregg 66cd30fa80 Small tweak to diagnostic message when OTA is started 2021-02-17 08:54:29 -06:00
HomeSpan edefa1380c
Update OTA.md 2021-02-17 08:15:08 -06:00
HomeSpan be71798836
Update OTA.md 2021-02-17 08:02:12 -06:00
HomeSpan d5757e6ab8
Update OTA.md 2021-02-16 21:55:10 -06:00
HomeSpan 3010e49347
Update OTA.md 2021-02-16 21:53:18 -06:00
HomeSpan 2aea557a3a
Update OTA.md 2021-02-16 18:58:00 -06:00
HomeSpan d60f9db3c5
Update OTA.md 2021-02-16 18:41:28 -06:00
HomeSpan 7e21159685
Create OTA.md 2021-02-16 17:30:13 -06:00
Gregg 269d749b5b Update src.ino 2021-02-16 07:19:48 -06:00
HomeSpan 121864ba36
Update Reference.md 2021-02-16 07:18:19 -06:00
HomeSpan 45e7c60dd1
Update Reference.md 2021-02-16 07:01:34 -06:00
HomeSpan 9450551947
Update Reference.md 2021-02-16 06:30:01 -06:00
HomeSpan f8b0e906bf
Update Tutorials.md 2021-02-15 21:13:24 -06:00
HomeSpan 0602b8ac3f
Update Reference.md 2021-02-15 21:00:59 -06:00