homebridge-xbox-tv 3.6.6 → 3.6.7
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/webApi/xboxwebapi.js +9 -3
package/package.json
CHANGED
package/src/webApi/xboxwebapi.js
CHANGED
|
@@ -26,14 +26,20 @@ class XboxWebApi extends EventEmitter {
|
|
|
26
26
|
}
|
|
27
27
|
this.authentication = new Authentication(authConfig);
|
|
28
28
|
|
|
29
|
-
//
|
|
29
|
+
//impulse generator
|
|
30
|
+
this.call = false;
|
|
30
31
|
this.impulseGenerator = new ImpulseGenerator();
|
|
31
32
|
this.impulseGenerator.on('checkAuthorization', async () => {
|
|
33
|
+
if (this.call) return;
|
|
34
|
+
|
|
32
35
|
try {
|
|
36
|
+
this.call = true;
|
|
33
37
|
await this.checkAuthorization();
|
|
38
|
+
this.call = false;
|
|
34
39
|
} catch (error) {
|
|
35
|
-
this.
|
|
36
|
-
|
|
40
|
+
this.call = false;
|
|
41
|
+
this.emit('error', `Inpulse generator error: ${error}`);
|
|
42
|
+
};
|
|
37
43
|
}).on('state', (state) => {
|
|
38
44
|
const emitState = state ? this.emit('success', `Web Api monitoring started`) : this.emit('warn', `Web Api monitoring stopped`);
|
|
39
45
|
});
|