homebridge-xbox-tv 2.10.2 → 2.10.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/xboxdevice.js +8 -1
package/package.json
CHANGED
package/src/xboxdevice.js
CHANGED
|
@@ -8,7 +8,7 @@ const XboxWebApi = require('./webApi/xboxwebapi.js');
|
|
|
8
8
|
const XboxLocalApi = require('./localApi/xboxlocalapi.js');
|
|
9
9
|
const CONSTANTS = require('./constans.json');
|
|
10
10
|
|
|
11
|
-
let Accessory, Characteristic, Service, Categories, UUID;
|
|
11
|
+
let Accessory, Characteristic, Service, Categories, Encode, UUID;
|
|
12
12
|
|
|
13
13
|
class XboxDevice extends EventEmitter {
|
|
14
14
|
constructor(api, prefDir, config) {
|
|
@@ -18,6 +18,7 @@ class XboxDevice extends EventEmitter {
|
|
|
18
18
|
Characteristic = api.hap.Characteristic;
|
|
19
19
|
Service = api.hap.Service;
|
|
20
20
|
Categories = api.hap.Categories;
|
|
21
|
+
Encode = api.hap.encode;
|
|
21
22
|
UUID = api.hap.uuid;
|
|
22
23
|
|
|
23
24
|
//device configuration
|
|
@@ -61,6 +62,7 @@ class XboxDevice extends EventEmitter {
|
|
|
61
62
|
|
|
62
63
|
//add configured inputs to the default inputs
|
|
63
64
|
this.inputs = [...CONSTANTS.DefaultInputs, ...this.inputs];
|
|
65
|
+
this.displayOrder = []
|
|
64
66
|
|
|
65
67
|
//setup variables
|
|
66
68
|
this.restFulConnected = false;
|
|
@@ -396,6 +398,10 @@ class XboxDevice extends EventEmitter {
|
|
|
396
398
|
await new Promise(resolve => setTimeout(resolve, 2000));
|
|
397
399
|
const accessory = await this.prepareAccessory();
|
|
398
400
|
this.emit('publishAccessory', accessory)
|
|
401
|
+
|
|
402
|
+
if (this.televisionService) {
|
|
403
|
+
this.televisionService.updateCharacteristic(Characteristic.DisplayOrder, Encode(1, this.displayOrder).toString('base64'));
|
|
404
|
+
}
|
|
399
405
|
} catch (error) {
|
|
400
406
|
this.emit('error', `prepare accessory error: ${error}`);
|
|
401
407
|
};
|
|
@@ -844,6 +850,7 @@ class XboxDevice extends EventEmitter {
|
|
|
844
850
|
}
|
|
845
851
|
});
|
|
846
852
|
|
|
853
|
+
this.displayOrder.push(1);
|
|
847
854
|
this.inputsOneStoreProductId.push(inputOneStoreProductId);
|
|
848
855
|
this.inputsReference.push(inputReference);
|
|
849
856
|
this.inputsName.push(inputName);
|