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 CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "displayName": "Xbox TV",
3
3
  "name": "homebridge-xbox-tv",
4
- "version": "3.6.6",
4
+ "version": "3.6.7",
5
5
  "description": "Homebridge plugin to control Xbox game consoles.",
6
6
  "license": "MIT",
7
7
  "author": "grzegorz914",
@@ -26,14 +26,20 @@ class XboxWebApi extends EventEmitter {
26
26
  }
27
27
  this.authentication = new Authentication(authConfig);
28
28
 
29
- //create impulse generator
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.emit('error', error);
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
  });