homebridge-melcloud-control 4.0.0-beta.504 → 4.0.0-beta.505

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 -7
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.504",
4
+ "version": "4.0.0-beta.505",
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
@@ -317,9 +317,9 @@ class MelCloud extends EventEmitter {
317
317
  const { stdout } = await execPromise(`"${chromiumPath}" --version`);
318
318
  this.emit('warn', `Test 0`);
319
319
  if (this.logDebug) this.emit('debug', `Chromium detected: ${stdout.trim()}`);
320
- } catch (err) {
320
+ } catch (error) {
321
321
  accountInfo.State = false;
322
- accountInfo.Info = `Chromium found at ${chromiumPath}, but cannot be executed: ${err.message}`;
322
+ accountInfo.Info = `Chromium found at ${chromiumPath}, but cannot be executed: ${error.message}`;
323
323
  return accountInfo;
324
324
  }
325
325
 
@@ -356,16 +356,13 @@ class MelCloud extends EventEmitter {
356
356
  page.on('close', () => { if (this.logDebug) this.emit('debug', 'Page was closed unexpectedly'); });
357
357
  browser.on('disconnected', () => { if (this.logWarn) this.emit('debug', 'Browser disconnected unexpectedly'); });
358
358
 
359
- page.setDefaultTimeout(45000);
360
- page.setDefaultNavigationTimeout(45000);
361
-
362
359
  // Now safe to navigate
363
360
  this.emit('warn', `Test 4`);
364
361
  try {
365
362
  await page.goto(ApiUrlsHome.BaseURL, { waitUntil: ['domcontentloaded', 'networkidle2'], timeout: 45000 });
366
- } catch (err) {
363
+ } catch (error) {
367
364
  accountInfo.State = false;
368
- accountInfo.Info = `Navigation to ${ApiUrlsHome.BaseURL} failed: ${err.message}`;
365
+ accountInfo.Info = `Navigation to ${ApiUrlsHome.BaseURL} failed: ${error.message}`;
369
366
  return accountInfo;
370
367
  }
371
368
  await new Promise(r => setTimeout(r, 4000));