Added Characteristic::ConfiguredNameStatic()
This "custom" Characteristic is identical to ConfiguredName() but only allows paired-read and notifications. By excluding paired-write it prevents the user from editing the name of a TV input source from the Home App. This is useful when some sources are fixed, such as "netflix" instead of generic, such as "hdmi 1".
This commit is contained in:
parent
7c32f7a364
commit
8a24819955
|
|
@ -161,6 +161,13 @@ void setup() {
|
|||
new Characteristic::TargetVisibilityState(0);
|
||||
new Characteristic::CurrentVisibilityState(0);
|
||||
|
||||
SpanService *hdmi11 = new Service::InputSource();
|
||||
new Characteristic::ConfiguredNameStatic("HDMI 11");
|
||||
new Characteristic::Identifier(11);
|
||||
new Characteristic::IsConfigured(1);
|
||||
new Characteristic::TargetVisibilityState(0);
|
||||
new Characteristic::CurrentVisibilityState(0);
|
||||
|
||||
(new Service::Television())
|
||||
->addLink(hdmi1)
|
||||
->addLink(hdmi2)
|
||||
|
|
@ -172,10 +179,12 @@ void setup() {
|
|||
->addLink(hdmi8)
|
||||
->addLink(hdmi9)
|
||||
->addLink(hdmi10)
|
||||
->addLink(hdmi11)
|
||||
;
|
||||
new Characteristic::Active(1);
|
||||
new Characteristic::ConfiguredName("AdvancedTV");
|
||||
new Characteristic::ActiveIdentifier(3);
|
||||
new Characteristic::ActiveIdentifier(3);
|
||||
new Characteristic::RemoteKey();
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -83,6 +83,7 @@ struct HapCharacteristics {
|
|||
HAPCHAR( CoolingThresholdTemperature, D, PR+PW+EV, FLOAT, false );
|
||||
HAPCHAR( ColorTemperature, CE, PR+PW+EV, UINT32, false );
|
||||
HAPCHAR( ConfiguredName, E3, PW+PR+EV, STRING, false );
|
||||
HAPCHAR( ConfiguredNameStatic, E3, PR+EV, STRING, false );
|
||||
HAPCHAR( ContactSensorState, 6A, PR+EV, UINT8, true );
|
||||
HAPCHAR( CurrentAmbientLightLevel, 6B, PR+EV, FLOAT, false );
|
||||
HAPCHAR( CurrentHorizontalTiltAngle, 6C, PR+EV, INT, false );
|
||||
|
|
@ -100,7 +101,6 @@ struct HapCharacteristics {
|
|||
HAPCHAR( CurrentTemperature, 11, PR+EV, FLOAT, false );
|
||||
HAPCHAR( CurrentTiltAngle, C1, PR+EV, INT, false );
|
||||
HAPCHAR( CurrentVisibilityState, 135, PR+EV, UINT8, true );
|
||||
// HAPCHAR( DisplayOrder, 136, PW+PR+EV, TLV8, false );
|
||||
HAPCHAR( FilterLifeLevel, AB, PR+EV, FLOAT, false );
|
||||
HAPCHAR( FilterChangeIndication, AC, PR+EV, UINT8, true );
|
||||
HAPCHAR( FirmwareRevision, 52, PR, STRING, true );
|
||||
|
|
|
|||
|
|
@ -332,8 +332,11 @@ namespace Service {
|
|||
struct Television : SpanService { Television() : SpanService{"D8","Television"}{
|
||||
REQ(Active);
|
||||
OPT(ConfiguredName);
|
||||
OPT(ConfiguredNameStatic);
|
||||
OPT(ActiveIdentifier);
|
||||
OPT(RemoteKey);
|
||||
OPT(PowerModeSelection);
|
||||
|
||||
OPT(SleepDiscoveryMode);
|
||||
OPT(Brightness);
|
||||
OPT(ClosedCaptions);
|
||||
|
|
@ -341,7 +344,6 @@ namespace Service {
|
|||
OPT(TargetMediaState);
|
||||
OPT(Name);
|
||||
OPT(PictureMode);
|
||||
OPT(PowerModeSelection);
|
||||
}};
|
||||
|
||||
struct TemperatureSensor : SpanService { TemperatureSensor() : SpanService{"8A","TemperatureSensor"}{
|
||||
|
|
@ -430,6 +432,7 @@ namespace Characteristic {
|
|||
CREATE_CHAR(uint32_t,ColorTemperature,200,140,500);
|
||||
CREATE_CHAR(uint8_t,ContactSensorState,1,0,1);
|
||||
CREATE_CHAR(const char *,ConfiguredName,"unnamed",0,1);
|
||||
CREATE_CHAR(const char *,ConfiguredNameStatic,"unnamed",0,1);
|
||||
CREATE_CHAR(double,CurrentAmbientLightLevel,1,0.0001,100000);
|
||||
CREATE_CHAR(int,CurrentHorizontalTiltAngle,0,-90,90);
|
||||
CREATE_CHAR(uint8_t,CurrentAirPurifierState,1,0,2);
|
||||
|
|
@ -446,7 +449,6 @@ namespace Characteristic {
|
|||
CREATE_CHAR(double,CurrentRelativeHumidity,0,0,100);
|
||||
CREATE_CHAR(double,CurrentTemperature,0,0,100);
|
||||
CREATE_CHAR(int,CurrentTiltAngle,0,-90,90);
|
||||
// CREATE_CHAR(tlv8,DisplayOrder,0,0,1);
|
||||
CREATE_CHAR(double,FilterLifeLevel,0,0,100);
|
||||
CREATE_CHAR(uint8_t,FilterChangeIndication,0,0,1);
|
||||
CREATE_CHAR(const char *,FirmwareRevision,"1.0.0",0,1);
|
||||
|
|
|
|||
Loading…
Reference in New Issue