homebridge-melcloud-control 4.0.0-beta.468 → 4.0.0-beta.469
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/functions.js +2 -2
- package/src/melcloud.js +5 -4
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.
|
|
4
|
+
"version": "4.0.0-beta.469",
|
|
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/functions.js
CHANGED
|
@@ -145,8 +145,8 @@ class Functions extends EventEmitter {
|
|
|
145
145
|
if (this.logDebug) this.emit('debug', `Chromium installed successfully at ${chromiumPath}`);
|
|
146
146
|
return chromiumPath;
|
|
147
147
|
}
|
|
148
|
-
} catch (
|
|
149
|
-
if (this.logDebug) this.emit('debug', `Install attempt failed: ${cmd} → ${
|
|
148
|
+
} catch (error) {
|
|
149
|
+
if (this.logDebug) this.emit('debug', `Install attempt failed: ${cmd} → ${error.message}`);
|
|
150
150
|
}
|
|
151
151
|
}
|
|
152
152
|
|
package/src/melcloud.js
CHANGED
|
@@ -306,6 +306,7 @@ class MelCloud extends EventEmitter {
|
|
|
306
306
|
browser = await puppeteer.launch({
|
|
307
307
|
headless: true,
|
|
308
308
|
executablePath: chromiumPath,
|
|
309
|
+
timeout: 45000,
|
|
309
310
|
args: [
|
|
310
311
|
'--no-sandbox',
|
|
311
312
|
'--disable-setuid-sandbox',
|
|
@@ -334,8 +335,8 @@ class MelCloud extends EventEmitter {
|
|
|
334
335
|
page.on('close', () => { if (this.logDebug) this.emit('debug', 'Page was closed unexpectedly'); });
|
|
335
336
|
browser.on('disconnected', () => { if (this.logWarn) this.emit('debug', 'Browser disconnected unexpectedly'); });
|
|
336
337
|
|
|
337
|
-
page.setDefaultTimeout(
|
|
338
|
-
page.setDefaultNavigationTimeout(
|
|
338
|
+
page.setDefaultTimeout(60000);
|
|
339
|
+
page.setDefaultNavigationTimeout(60000);
|
|
339
340
|
|
|
340
341
|
// Now safe to navigate
|
|
341
342
|
await page.goto(ApiUrlsHome.BaseURL, { waitUntil: ['domcontentloaded', 'networkidle2'] });
|
|
@@ -445,7 +446,7 @@ class MelCloud extends EventEmitter {
|
|
|
445
446
|
}
|
|
446
447
|
|
|
447
448
|
async connect(refresh) {
|
|
448
|
-
const TIMEOUT_MS =
|
|
449
|
+
const TIMEOUT_MS = 75000;
|
|
449
450
|
|
|
450
451
|
try {
|
|
451
452
|
const result = await Promise.race([
|
|
@@ -459,7 +460,7 @@ class MelCloud extends EventEmitter {
|
|
|
459
460
|
return {};
|
|
460
461
|
}
|
|
461
462
|
})(),
|
|
462
|
-
new Promise((_, reject) => setTimeout(() => reject(new Error('Connection timeout (
|
|
463
|
+
new Promise((_, reject) => setTimeout(() => reject(new Error('Connection timeout (75s)')), TIMEOUT_MS))
|
|
463
464
|
]);
|
|
464
465
|
|
|
465
466
|
return result;
|