Disabled features for default remote

This commit is contained in:
watsonb8 2019-07-26 16:30:57 -04:00
parent 9b48614dd1
commit 73cba09edb

View File

@ -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));
this.televisionService.getCharacteristic(Characteristic.RemoteKey)
//@ts-ignore
.on("set", callbackify(this.onSetRemoteKey));
//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,15 +172,17 @@ export class ControlUnit implements IAccessory {
* Event handler for SET remote key
*/
private onSetRemoteKey = async (key: any) => {
//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);
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);
this.dataProvider.sendKeyPress(this.name, key);
this.dataProvider.sendKeyPress(this.name, key);
}
}
/**
@ -233,9 +241,11 @@ export class ControlUnit implements IAccessory {
* Event handler for SET volume characteristic
*/
private onSetVolumeSelector = async (value: any) => {
switch (value) {
case 0: this.dataProvider.volumeUp(this.name); break;
case 1: this.dataProvider.volumeDown(this.name); break;
if (this.isExternal) {
switch (value) {
case 0: this.dataProvider.volumeUp(this.name); break;
case 1: this.dataProvider.volumeDown(this.name); break;
}
}
}