diff --git a/src/HomeSpan.h b/src/HomeSpan.h index 828fab2..299c0b8 100644 --- a/src/HomeSpan.h +++ b/src/HomeSpan.h @@ -442,9 +442,12 @@ struct SpanCharacteristic{ uvSet(stepValue,0); } - boolean isCustom=strchr(type,'-'); + int x=0; + sscanf(type,"%*8[0-9a-fA-F]-%*4[0-9a-fA-F]-%*4[0-9a-fA-F]-%*4[0-9a-fA-F]-%*12[0-9a-fA-F]%n",&x); + + boolean isCustom=(strlen(type)==36 && x==36); - homeSpan.configLog+="(" + uvPrint(value) + ")" + ": IID=" + String(iid) + ", UUID=\"" + String(type) + "\""; + homeSpan.configLog+="(" + uvPrint(value) + ")" + ": IID=" + String(iid) + ", " + (isCustom?"Custom-":"") + "UUID=\"" + String(type) + "\""; if(format!=FORMAT::STRING && format!=FORMAT::BOOL) homeSpan.configLog+= ", Range=[" + String(uvPrint(minValue)) + "," + String(uvPrint(maxValue)) + "]"; @@ -462,8 +465,8 @@ struct SpanCharacteristic{ valid=!strcmp(type,homeSpan.Accessories.back()->Services.back()->opt[i]->type); if(!valid){ - homeSpan.configLog+=" *** ERROR! Service does not support this Characteristic. ***"; - homeSpan.nFatalErrors++; + homeSpan.configLog+=" *** WARNING! Service does not support this Characteristic. ***"; + homeSpan.nWarnings++; } boolean repeated=false; diff --git a/src/Span.h b/src/Span.h index 787616e..bf23dc4 100644 --- a/src/Span.h +++ b/src/Span.h @@ -329,7 +329,6 @@ namespace Service { struct Television : SpanService { Television() : SpanService{"D8","Television"}{ REQ(Active); OPT(ConfiguredName); - OPT(ConfiguredNameStatic); OPT(ActiveIdentifier); OPT(RemoteKey); OPT(PowerModeSelection); diff --git a/src/src.ino b/src/src.ino index b381edd..cb21b6b 100644 --- a/src/src.ino +++ b/src/src.ino @@ -4,7 +4,7 @@ #include "HomeSpan.h" -CUSTOM_CHAR(CustomActive, AB-123-B0, PW+PR+EV, UINT8, 0, 0, 1, false); +CUSTOM_CHAR(CustomActive, E863F10A-079E-48FF-8F27-9C2605A29F52, PR+EV, UINT16, 0, 0, 4800, false); void setup() { @@ -45,19 +45,18 @@ void setup() { new Service::LightBulb(); new Characteristic::On(0); - SpanCharacteristic *active = new Characteristic::CustomActive(); + new Characteristic::CustomActive(1200); new Characteristic::Brightness(50); new Characteristic::Name("Light 1"); new Characteristic::ColorTemperature(); new Characteristic::Active(); new Service::LightBulb(); new Characteristic::On(0,true); - (new Characteristic::Brightness(50,true))->setRange(10,100,5); + (new Characteristic::Brightness(50,false))->setRange(10,100,5); new Characteristic::Name("Light 2"); new SpanAccessory(); // Begin by creating a new Accessory using SpanAccessory(), which takes no arguments -// active->setRange(0,10,3); new Service::AccessoryInformation(); // HAP requires every Accessory to implement an AccessoryInformation Service, which has 6 required Characteristics new Characteristic::Name("HomeSpan Test"); // Name of the Accessory, which shows up on the HomeKit "tiles", and should be unique across Accessories new Characteristic::Manufacturer("HomeSpan"); // Manufacturer of the Accessory (arbitrary text string, and can be the same for every Accessory) @@ -73,6 +72,8 @@ void setup() { new Characteristic::On(0,true); (new Characteristic::Brightness(50,true))->setRange(10,100,5); new Characteristic::Name("Light 3"); + new Characteristic::TargetPosition(); + new Characteristic::OzoneDensity(); } // end of setup()