diff --git a/Other Examples/Television/Television.ino b/Other Examples/Television/Television.ino index fda3581..39a232b 100644 --- a/Other Examples/Television/Television.ino +++ b/Other Examples/Television/Television.ino @@ -189,6 +189,11 @@ void setup() { new Characteristic::CurrentVisibilityState(0); // ...and included in the Selection List... new Characteristic::TargetVisibilityState(0); // ...and a "checked" checkbox is provided on the Settings Screen that can be used to toggle CurrentVisibilityState() + SpanService *speaker = new Service::TelevisionSpeaker(); + new Characteristic::Mute(); + new Characteristic::VolumeSelector(); + new Characteristic::VolumeControlType(3); + (new HomeSpanTV("Test TV")) // Define a Television Service. Must link in InputSources! ->addLink(hdmi1) ->addLink(hdmi2) @@ -200,6 +205,7 @@ void setup() { ->addLink(hdmi8) ->addLink(hdmi9) ->addLink(hdmi10) + ->addLink(speaker) ; } diff --git a/src/Characteristics.h b/src/Characteristics.h index 5bce47c..e5d075f 100644 --- a/src/Characteristics.h +++ b/src/Characteristics.h @@ -192,7 +192,7 @@ struct HapCharacteristics { HAPCHAR( VOCDensity, C8, PR+EV, FLOAT, false ); HAPCHAR( Volume, 119, PW+PR+EV, UINT8, false ); HAPCHAR( VolumeControlType, E9, PR+EV, UINT8, true ); - HAPCHAR( VolumeSelector, EA, PR+EV, UINT8, true ); + HAPCHAR( VolumeSelector, EA, PW, UINT8, true ); HAPCHAR( WaterLevel, B5, PR+EV, FLOAT, false ); }; diff --git a/src/HomeSpan.cpp b/src/HomeSpan.cpp index e5328ee..6d8718c 100644 --- a/src/HomeSpan.cpp +++ b/src/HomeSpan.cpp @@ -911,7 +911,7 @@ void Span::processSerialCommand(const char *c){ aidValues.insert((*acc)->aid); for(auto svc=(*acc)->Services.begin(); svc!=(*acc)->Services.end(); svc++){ - Serial.printf(" \u279f Service %s: IID=%d, %sUUIS=\"%s\"",(*svc)->hapName,(*svc)->iid,(*svc)->isCustom?"Custom-":"",(*svc)->type); + Serial.printf(" \u279f Service %s: IID=%d, %sUUID=\"%s\"",(*svc)->hapName,(*svc)->iid,(*svc)->isCustom?"Custom-":"",(*svc)->type); Serial.printf("\n"); if(!strcmp((*svc)->type,"3E")){ diff --git a/src/Span.h b/src/Span.h index 8bb10da..04747ba 100644 --- a/src/Span.h +++ b/src/Span.h @@ -335,6 +335,14 @@ namespace Service { OPT(PowerModeSelection); }}; + struct TelevisionSpeaker : SpanService { TelevisionSpeaker() : SpanService{"113","TelevisionSpeaker"}{ + REQ(Mute); + OPT(Active); + OPT(Volume); + OPT(VolumeControlType); + OPT(VolumeSelector); + }}; + struct TemperatureSensor : SpanService { TemperatureSensor() : SpanService{"8A","TemperatureSensor"}{ REQ(CurrentTemperature); OPT(Name);