From 89024bc5558a61a1f49c7e212fded8acb4f3894b Mon Sep 17 00:00:00 2001 From: Gregg Date: Sat, 21 Nov 2020 13:52:04 -0600 Subject: [PATCH] Made first argument of homeSpan.begin() optional Default is Category::Lighting --- src/HomeSpan.h | 2 +- src/Settings.h | 1 + src/src.ino | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/HomeSpan.h b/src/HomeSpan.h index d4688b6..b99f62c 100644 --- a/src/HomeSpan.h +++ b/src/HomeSpan.h @@ -105,7 +105,7 @@ struct Span{ HapCharList chr; // list of all HAP Characteristics - void begin(Category catID, + void begin(Category catID=DEFAULT_CATEGORY, char *displayName=DEFAULT_DISPLAY_NAME, char *hostNameBase=DEFAULT_HOST_NAME, char *modelName=DEFAULT_MODEL_NAME); diff --git a/src/Settings.h b/src/Settings.h index 6773dbc..f8688a8 100644 --- a/src/Settings.h +++ b/src/Settings.h @@ -38,6 +38,7 @@ ////////////////////////////////////////////////////// // DEFAULT SETTINGS // +#define DEFAULT_CATEGORY Category::Lighting // change with optional first argument in homeSpan.begin() #define DEFAULT_DISPLAY_NAME "HomeSpan Server" // change with optional second argument in homeSpan.begin() #define DEFAULT_HOST_NAME "HomeSpan" // change with optional third argument in homeSpan.begin() #define DEFAULT_MODEL_NAME "HomeSpan-ESP32" // change with optional fourth argument in homeSpan.begin() diff --git a/src/src.ino b/src/src.ino index 752b002..16a6ecb 100644 --- a/src/src.ino +++ b/src/src.ino @@ -10,7 +10,7 @@ void setup() { homeSpan.setLogLevel(2); - homeSpan.begin(Category::Lighting,"HomeSpan Benchmark"); + homeSpan.begin(); new SpanAccessory(); // Begin by creating a new Accessory using SpanAccessory(), which takes no arguments