Disabled features for default remote
This commit is contained in:
parent
9b48614dd1
commit
73cba09edb
@ -85,7 +85,10 @@ export class ControlUnit implements IAccessory {
|
||||
|
||||
//Configure services
|
||||
this.configureTvService();
|
||||
|
||||
this.configureTvSpeakerService();
|
||||
|
||||
|
||||
// this.configureAccessoryInformation();
|
||||
this.configureInputSourceService();
|
||||
|
||||
@ -130,9 +133,12 @@ export class ControlUnit implements IAccessory {
|
||||
//@ts-ignore
|
||||
.on("get", callbackify(this.onGetAccessoryActive));
|
||||
|
||||
//Set remote characteristics if is external
|
||||
if (this.isExternal) {
|
||||
this.televisionService.getCharacteristic(Characteristic.RemoteKey)
|
||||
//@ts-ignore
|
||||
.on("set", callbackify(this.onSetRemoteKey));
|
||||
}
|
||||
|
||||
this.televisionService.getCharacteristic(Characteristic.ActiveIdentifier)
|
||||
//@ts-ignore
|
||||
@ -166,16 +172,18 @@ export class ControlUnit implements IAccessory {
|
||||
* Event handler for SET remote key
|
||||
*/
|
||||
private onSetRemoteKey = async (key: any) => {
|
||||
if (this.isExternal) {
|
||||
//Set the active identifier with every key press
|
||||
let currentActivity: Activity = this.dataProvider.getIsActive(this.name)!;
|
||||
let identifier: number = 0;
|
||||
if (currentActivity) {
|
||||
identifier = this.activities.findIndex(e => e.displayName === currentActivity.displayName);
|
||||
}
|
||||
this.televisionService!.setCharacteristic(Characteristic.ActiveIdentifier, identifier);
|
||||
// let currentActivity: Activity = this.dataProvider.getIsActive(this.name)!;
|
||||
// let identifier: number = 0;
|
||||
// if (currentActivity) {
|
||||
// identifier = this.activities.findIndex(e => e.displayName === currentActivity.displayName);
|
||||
// }
|
||||
// this.televisionService!.setCharacteristic(Characteristic.ActiveIdentifier, identifier);
|
||||
|
||||
this.dataProvider.sendKeyPress(this.name, key);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Event handler for SET active identifier characteristic
|
||||
@ -233,11 +241,13 @@ export class ControlUnit implements IAccessory {
|
||||
* Event handler for SET volume characteristic
|
||||
*/
|
||||
private onSetVolumeSelector = async (value: any) => {
|
||||
if (this.isExternal) {
|
||||
switch (value) {
|
||||
case 0: this.dataProvider.volumeUp(this.name); break;
|
||||
case 1: this.dataProvider.volumeDown(this.name); break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*********************
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user