From 24c953aa76483ac54013b89d514b63bd901217d6 Mon Sep 17 00:00:00 2001 From: Grzegorz Date: Fri, 3 Sep 2021 15:12:26 +0200 Subject: [PATCH] bump 1.7.1 --- index.js | 14 ++++++-------- package.json | 2 +- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/index.js b/index.js index c3a0981..005c7ba 100644 --- a/index.js +++ b/index.js @@ -123,6 +123,7 @@ class xboxTvPlatform { class xboxTvDevice { constructor(log, config, api) { this.log = log; + this.config = config; this.api = api; //device configuration @@ -175,7 +176,6 @@ class xboxTvDevice { //setup variables this.connectedToDevice = false; this.checkDeviceInfo = false; - this.startPrepareAccessory = true; this.webApiEnabled = false; this.inputsService = new Array(); @@ -260,6 +260,9 @@ class xboxTvDevice { }.bind(this), 60000); const getWebApiToken = this.webApiControl ? this.getWebApiToken() : false; + + //start prepare accessory + this.prepareAccessory(); } connectToXbox() { @@ -657,11 +660,6 @@ class xboxTvDevice { this.log('Serialnr: %s', serialNumber); this.log('Firmware: %s', firmwareRevision); this.log('----------------------------------'); - - //start prepare accessory - if (this.startPrepareAccessory) { - this.prepareAccessory(); - } } this.titleId = titleId; @@ -757,9 +755,10 @@ class xboxTvDevice { async prepareAccessory() { this.log.debug('prepareAccessory'); const accessoryName = this.name; - const accessoryUUID = AccessoryUUID.generate(accessoryName); + const accessoryUUID = AccessoryUUID.generate(this.xboxliveid); const accessoryCategory = Categories.TV_SET_TOP_BOX; const accessory = new Accessory(accessoryName, accessoryUUID, accessoryCategory); + accessory.context.device = this.config.device; //Prepare information service this.log.debug('prepareInformationService'); @@ -1348,7 +1347,6 @@ class xboxTvDevice { accessory.addService(this.buttonsService[i]); } - this.startPrepareAccessory = false; this.log.debug('Device: %s %s, publishExternalAccessories.', this.host, accessoryName); this.api.publishExternalAccessories(PLUGIN_NAME, [accessory]); } diff --git a/package.json b/package.json index bc1cfc8..04db0f6 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "displayName": "Xbox TV", "name": "homebridge-xbox-tv", - "version": "1.7.0", + "version": "1.7.1", "description": "Homebridge plugin (https://github.com/homebridge/homebridge) to control Xbox game consoles.", "license": "MIT", "author": "grzegorz914",