Cleaned up unused code. Corrected issue with getActive
This commit is contained in:
		| @@ -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 | ||||
|   | ||||
		Reference in New Issue
	
	Block a user