homebridge-melcloud-control 4.0.0-beta.491 → 4.0.0-beta.492

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/melcloud.js +4 -10
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "displayName": "MELCloud Control",
3
3
  "name": "homebridge-melcloud-control",
4
- "version": "4.0.0-beta.491",
4
+ "version": "4.0.0-beta.492",
5
5
  "description": "Homebridge plugin to control Mitsubishi Air Conditioner, Heat Pump and Energy Recovery Ventilation.",
6
6
  "license": "MIT",
7
7
  "author": "grzegorz914",
package/src/melcloud.js CHANGED
@@ -356,10 +356,7 @@ class MelCloud extends EventEmitter {
356
356
  return null;
357
357
  }
358
358
 
359
- await Promise.race([
360
- Promise.all([loginBtn.click(), page.waitForNavigation({ waitUntil: ['domcontentloaded', 'networkidle2'], timeout: 15000 })]),
361
- new Promise(r => setTimeout(r, 12000))
362
- ]);
359
+ await Promise.race([Promise.all([loginBtn.click(), page.waitForNavigation({ waitUntil: ['domcontentloaded', 'networkidle2'], timeout: 10000 })]), new Promise(r => setTimeout(r, 8000))]);
363
360
 
364
361
  this.emit('warn', `Test 7`);
365
362
  const usernameInput = await page.$('input[name="username"]');
@@ -380,10 +377,7 @@ class MelCloud extends EventEmitter {
380
377
  return null;
381
378
  }
382
379
 
383
- await Promise.race([
384
- Promise.all([submitButton.click(), page.waitForNavigation({ waitUntil: ['domcontentloaded', 'networkidle2'], timeout: 20000 })]),
385
- new Promise(r => setTimeout(r, 15000))
386
- ]);
380
+ await Promise.race([Promise.all([submitButton.click(), page.waitForNavigation({ waitUntil: ['domcontentloaded', 'networkidle2'], timeout: 10000 })]), new Promise(r => setTimeout(r, 8000))]);
387
381
 
388
382
  this.emit('warn', `Test 10`);
389
383
  let c1 = null, c2 = null;
@@ -450,7 +444,7 @@ class MelCloud extends EventEmitter {
450
444
  }
451
445
 
452
446
  async connect(refresh) {
453
- const TIMEOUT_MS = 75000;
447
+ const TIMEOUT_MS = 60000;
454
448
 
455
449
  try {
456
450
  const result = await Promise.race([
@@ -464,7 +458,7 @@ class MelCloud extends EventEmitter {
464
458
  return {};
465
459
  }
466
460
  })(),
467
- new Promise((_, reject) => setTimeout(() => reject(new Error('Connection timeout (75s)')), TIMEOUT_MS))
461
+ new Promise((_, reject) => setTimeout(() => reject(new Error('Connection timeout (60s)')), TIMEOUT_MS))
468
462
  ]);
469
463
 
470
464
  return result;