homebridge-xbox-tv 2.11.3 → 2.11.5
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 +3 -6
package/package.json
CHANGED
package/src/xboxdevice.js
CHANGED
|
@@ -273,8 +273,9 @@ class XboxDevice extends EventEmitter {
|
|
|
273
273
|
}
|
|
274
274
|
})
|
|
275
275
|
.on('stateChanged', (power, volume, mute, mediaState, titleId, reference) => {
|
|
276
|
-
const inputIdentifierR = this.inputsConfigured.findIndex(index => index.reference === reference) ??
|
|
277
|
-
const
|
|
276
|
+
const inputIdentifierR = this.inputsConfigured.findIndex(index => index.reference === reference) ?? -1;
|
|
277
|
+
const inputIdentifierT = this.inputsConfigured.findIndex(index => index.titleId === titleId) ?? -1;
|
|
278
|
+
const inputIdentifier = inputIdentifierR !== -1 ? inputIdentifierR : inputIdentifierT;
|
|
278
279
|
|
|
279
280
|
//update characteristics
|
|
280
281
|
if (this.televisionService) {
|
|
@@ -396,10 +397,6 @@ class XboxDevice extends EventEmitter {
|
|
|
396
397
|
await new Promise(resolve => setTimeout(resolve, 2000));
|
|
397
398
|
const accessory = await this.prepareAccessory();
|
|
398
399
|
this.emit('publishAccessory', accessory)
|
|
399
|
-
|
|
400
|
-
if (this.televisionService) {
|
|
401
|
-
this.televisionService.updateCharacteristic(Characteristic.DisplayOrder, Encode(1, this.displayOrder).toString('base64'));
|
|
402
|
-
}
|
|
403
400
|
} catch (error) {
|
|
404
401
|
this.emit('error', `prepare accessory error: ${error}`);
|
|
405
402
|
};
|