Skip to content

Commit

Permalink
bump 1.7.1
Browse files Browse the repository at this point in the history
  • Loading branch information
grzegorz914 committed Sep 3, 2021
1 parent 24cf64d commit 24c953a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
14 changes: 6 additions & 8 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ class xboxTvPlatform {
class xboxTvDevice {
constructor(log, config, api) {
this.log = log;
this.config = config;
this.api = api;

//device configuration
Expand Down Expand Up @@ -175,7 +176,6 @@ class xboxTvDevice {
//setup variables
this.connectedToDevice = false;
this.checkDeviceInfo = false;
this.startPrepareAccessory = true;
this.webApiEnabled = false;

this.inputsService = new Array();
Expand Down Expand Up @@ -260,6 +260,9 @@ class xboxTvDevice {
}.bind(this), 60000);

const getWebApiToken = this.webApiControl ? this.getWebApiToken() : false;

//start prepare accessory
this.prepareAccessory();
}

connectToXbox() {
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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');
Expand Down Expand Up @@ -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]);
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down

0 comments on commit 24c953a

Please sign in to comment.