From 4acddaa7ab4669684550f9f9d20b6e9173cbe16a Mon Sep 17 00:00:00 2001 From: HomeSpan Date: Wed, 25 Nov 2020 15:18:31 -0600 Subject: [PATCH] Update Reference.md --- docs/Reference.md | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/docs/Reference.md b/docs/Reference.md index b2a424a..8234ebd 100644 --- a/docs/Reference.md +++ b/docs/Reference.md @@ -12,7 +12,7 @@ At runtime this HomeSpan will create a global object named `homeSpan` that suppo * Initializes HomeSpan. * **Must** be called at the beginning of each sketch before any other HomeSpan functions and is typically placed near the top of the Arduino `setup()` method, but **after** `Serial.begin()` so that initialization diagnostics can be output to the Serial Monitor. * All arguments are **optional**. - * *catID* - the HAP Category HomeSpan broadcasts for pairing to HomeKit. Default is Category::Lighting. See [HomeSpan Categories](Categories.md) for a complete list. + * *catID* - the HAP Category HomeSpan broadcasts for pairing to HomeKit. Default is Category::Lighting. See [HomeSpan Accessory Categories](Categories.md) for a complete list. * *displayName* - the MDNS display name broadcast by HomeSpan. Default is "HomeSpan Server". * *hostNameBase* - the full MDNS host name is broadcast by HomeSpan as *hostNameBase-DeviceID*.local, where DeviceID is a unique 6-byte code generated automatically by HomeSpan. Default is "HomeSpan". * *modelName* - the HAP model name HomeSpan broadcasts for pairing to HomeKit. Default is "HomeSpan-ESP32". @@ -50,3 +50,16 @@ The following **optional** `homeSpan` methods override various HomeSpan initiali * `void setMaxConnections(uint8_t nCon)` * Sets the maximum number of HAP Controllers that be simultaneously connected to HomeSpan (default=8). + +## Creating the HAP Accessory Attributes Database - Primary Classes + +The HAP Accessory Attributes Database is constructed by instantiating (using `new`) a combinaton of the following HomeSpan Classes: + +* `SpanAccessory()` + * This creates a new HAP Accessory to hold HAP Services. + * There are no arguments or methods. + * You must call `homeSpan.begin()` before instantiating any Accessories. + * Every HomeSpan sketch requires at least one Accessory. + +* `SpanService()` + * This is the base class for creating new HAP Services. It should