Added Service::TelevisionSpeaker
Also updated Television Example. Volume buttons on remote now function as expected, though there does not seems to be a mute button
This commit is contained in:
parent
ea07da5ab0
commit
7939624bf7
|
|
@ -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)
|
||||
;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 );
|
||||
|
||||
};
|
||||
|
|
|
|||
|
|
@ -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")){
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue