Update Reference.md

This commit is contained in:
HomeSpan 2021-09-05 09:29:08 -05:00 committed by GitHub
parent 946819f3d4
commit 3d6bc0d095
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 0 deletions

View File

@ -217,6 +217,14 @@ The following methods are supported:
* returns a pointer to the Characteristic itself so that the method can be chained during instantiation
* example: `(new Characteristic::Brightness(50))->setRange(10,100,5);`
* `SpanCharacteristic *setValidValues(int n, [int v1, int v2 ...])`
* overrides the default HAP Valid Values for Characteristics that have specific enumerated Valid Values with a variable-length list of *n* values *v1*, *v2*, etc.
* an error is thrown if:
* called on a Characteristic that does not have specific enumerated Valid Values, or
* called more than once on the same Characteristic
* returns a pointer to the Characteristic itself so that the method can be chained during instantiation
* example: `(new Characteristic::SecuritySystemTargetState())->setValidValues(3,0,1,3);` creates a new valid value list of length=3 containing the values 0, 1, and 3. This has the effect of informing the HomeKit that a SecuritySystemTargetState value of 2 (Night Arm) is not valid and should not be shown as a choice in the Home App
## *SpanButton(int pin, uint16_t longTime, uint16_t singleTime, uint16_t doubleTime)*
Creating an instance of this **class** attaches a pushbutton handler to the ESP32 *pin* specified.