homebridge-xbox-tv 2.12.1 → 2.12.2
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 +4 -3
package/package.json
CHANGED
package/src/xboxdevice.js
CHANGED
|
@@ -497,9 +497,9 @@ class XboxDevice extends EventEmitter {
|
|
|
497
497
|
const logInfo = this.disableLogInfo ? false : this.emit('message', `Input: ${inputName}, Reference: ${inputReference}, Product Id: ${inputOneStoreProductId}`);
|
|
498
498
|
return inputIdentifier;
|
|
499
499
|
})
|
|
500
|
-
.onSet(async (
|
|
500
|
+
.onSet(async (activeIdentifier) => {
|
|
501
501
|
try {
|
|
502
|
-
const index = this.inputsConfigured.findIndex(input => input.identifier ===
|
|
502
|
+
const index = this.inputsConfigured.findIndex(input => input.identifier === activeIdentifier);
|
|
503
503
|
const inputOneStoreProductId = this.inputsConfigured[index].oneStoreProductId;
|
|
504
504
|
const inputReference = this.inputsConfigured[index].reference;
|
|
505
505
|
const inputName = this.inputsConfigured[index].name;
|
|
@@ -510,7 +510,8 @@ class XboxDevice extends EventEmitter {
|
|
|
510
510
|
switch (this.power) {
|
|
511
511
|
case false:
|
|
512
512
|
await new Promise(resolve => setTimeout(resolve, 4000));
|
|
513
|
-
const
|
|
513
|
+
const inputIdentifier = index !== -1 ? this.inputsConfigured[index].identifier : -1;
|
|
514
|
+
const tryAgain = this.power && inputIdentifier !== -1 ? this.televisionService.setCharacteristic(Characteristic.ActiveIdentifier, inputIdentifier) : false;
|
|
514
515
|
break;
|
|
515
516
|
case true:
|
|
516
517
|
switch (inputOneStoreProductId) {
|