diff --git a/src/Accessories/ControlUnit.ts b/src/Accessories/ControlUnit.ts index 3e40c47..c40a199 100644 --- a/src/Accessories/ControlUnit.ts +++ b/src/Accessories/ControlUnit.ts @@ -134,11 +134,10 @@ export class ControlUnit implements IAccessory { .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.RemoteKey) + //@ts-ignore + .on("set", callbackify(this.onSetRemoteKey)); + this.televisionService.getCharacteristic(Characteristic.ActiveIdentifier) //@ts-ignore @@ -165,7 +164,7 @@ export class ControlUnit implements IAccessory { */ private onGetAccessoryActive = async () => { //@ts-ignore - return this.dataProvider.getIsActive() ? Characteristic.Active.Active : Characteristic.Active.Inactive + return this.dataProvider.getIsActive(this.name) ? Characteristic.Active.Active : Characteristic.Active.Inactive } /** @@ -173,14 +172,6 @@ export class ControlUnit implements IAccessory { */ 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); - this.dataProvider.sendKeyPress(this.name, key); } } @@ -249,22 +240,6 @@ export class ControlUnit implements IAccessory { } } - /********************* - * - * Information Service - * - ********************/ - - /** - * Configure information service - */ - private configureAccessoryInformation(): void { - this.informationService = new Service.AccessoryInformation(this.displayName, 'information'); - this.informationService - .setCharacteristic(Characteristic.Manufacturer, 'Loftux Carwings') - .setCharacteristic(Characteristic.Model, 'Heater-Cooler') - } - /***************** * * Input services