From 83ad277aa0fd126b206770ccc70eb975dc4fed08 Mon Sep 17 00:00:00 2001 From: Gregg Date: Sun, 26 Nov 2023 18:19:36 -0600 Subject: [PATCH] Addressed issue with new Characteristic enum constants --- examples/Other Examples/MaxAccessories/MaxAccessories.ino | 8 +++----- src/HomeSpan.h | 4 ++-- src/Span.h | 2 +- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/examples/Other Examples/MaxAccessories/MaxAccessories.ino b/examples/Other Examples/MaxAccessories/MaxAccessories.ino index 5eb916b..a20db88 100644 --- a/examples/Other Examples/MaxAccessories/MaxAccessories.ino +++ b/examples/Other Examples/MaxAccessories/MaxAccessories.ino @@ -32,8 +32,7 @@ void setup() { Serial.begin(115200); homeSpan.setLogLevel(2); -// homeSpan.enableWebLog(500,"pool.ntp.org","UTC"); -// homeSpan.setWifiCallback(wifiEstablished); + homeSpan.enableWebLog(500); homeSpan.begin(Category::Lighting,"HomeSpan Max"); @@ -41,7 +40,7 @@ void setup() { new Service::AccessoryInformation(); new Characteristic::Identify(); - for(int i=0;i<40;i++){ + for(int i=0;i<139;i++){ new SpanAccessory(); new Service::AccessoryInformation(); new Characteristic::Identify(); @@ -61,6 +60,5 @@ void setup() { void loop(){ - homeSpan.poll(); - + homeSpan.poll(); } diff --git a/src/HomeSpan.h b/src/HomeSpan.h index 07e790e..2bf8323 100644 --- a/src/HomeSpan.h +++ b/src/HomeSpan.h @@ -610,7 +610,7 @@ class SpanCharacteristic{ case FORMAT::DATA: break; } - return(0); // included to prevent compiler warnings + return((T)0); // included to prevent compiler warnings } protected: @@ -771,7 +771,7 @@ class SpanCharacteristic{ } if(val < uvGet(minValue) || val > uvGet(maxValue)){ - LOG0("\n*** WARNING: Attempt to update Characteristic::%s with setVal(%g) is out of range [%g,%g]. This may cause device to become non-reponsive!\n\n", + LOG0("\n*** WARNING: Attempt to update Characteristic::%s with setVal(%g) is out of range [%g,%g]. This may cause device to become non-responsive!\n\n", hapName,(double)val,uvGet(minValue),uvGet(maxValue)); } diff --git a/src/Span.h b/src/Span.h index 7ae6675..2f9f03e 100644 --- a/src/Span.h +++ b/src/Span.h @@ -520,7 +520,7 @@ namespace Characteristic { CREATE_CHAR(double,TargetRelativeHumidity,0,0,100); CREATE_CHAR(double,TargetTemperature,16,10,38); CREATE_CHAR(uint8_t,TargetVisibilityState,0,0,1); - CREATE_CHAR(uint8_t,TemperatureDisplayUnits,0,0,1); + CREATE_CHAR(uint8_t,TemperatureDisplayUnits,0,0,1,CELSIUS,FAHRENHEIT); CREATE_CHAR(int,TargetVerticalTiltAngle,0,-90,90); CREATE_CHAR(uint8_t,ValveType,0,0,3); CREATE_CHAR(const char *,Version,"1.0.0",0,1);