homebridge-xbox-tv 2.11.3 → 2.11.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "displayName": "Xbox TV",
3
3
  "name": "homebridge-xbox-tv",
4
- "version": "2.11.3",
4
+ "version": "2.11.4",
5
5
  "description": "Homebridge plugin to control Xbox game consoles.",
6
6
  "license": "MIT",
7
7
  "author": "grzegorz914",
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) ?? 0;
277
- const inputIdentifier = inputIdentifierR > 0 ? inputIdentifierR : this.inputsConfigured.findIndex(index => index.titleId === titleId) + 1;
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) {