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.
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.
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.
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.
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.
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.
Functionality is identical, but template has been moved into UVal structure along with setVal, which simplifies code and allows for other uses if needed.
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.
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.