homebridge-melcloud-control 4.0.0-beta.470 → 4.0.0-beta.471
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/melcloud.js +4 -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.471",
|
|
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
|
@@ -328,15 +328,15 @@ class MelCloud extends EventEmitter {
|
|
|
328
328
|
}
|
|
329
329
|
|
|
330
330
|
// Ensure page is ready
|
|
331
|
-
await new Promise(r => setTimeout(r,
|
|
331
|
+
await new Promise(r => setTimeout(r, 250));
|
|
332
332
|
|
|
333
333
|
page.on('error', err => { if (this.logError) this.emit('error', `Page crashed: ${err.message}`); });
|
|
334
334
|
page.on('pageerror', err => { if (this.logDebug) this.emit('error', `Browser error: ${err.message}`); });
|
|
335
335
|
page.on('close', () => { if (this.logDebug) this.emit('debug', 'Page was closed unexpectedly'); });
|
|
336
336
|
browser.on('disconnected', () => { if (this.logWarn) this.emit('debug', 'Browser disconnected unexpectedly'); });
|
|
337
337
|
|
|
338
|
-
page.setDefaultTimeout(
|
|
339
|
-
page.setDefaultNavigationTimeout(
|
|
338
|
+
page.setDefaultTimeout(30000);
|
|
339
|
+
page.setDefaultNavigationTimeout(30000);
|
|
340
340
|
|
|
341
341
|
// Now safe to navigate
|
|
342
342
|
await page.goto(ApiUrlsHome.BaseURL, { waitUntil: ['domcontentloaded', 'networkidle2'] });
|
|
@@ -346,7 +346,7 @@ class MelCloud extends EventEmitter {
|
|
|
346
346
|
loginBtn = await page.waitForFunction(() => {
|
|
347
347
|
const btns = Array.from(document.querySelectorAll('button.btn--blue'));
|
|
348
348
|
return btns.find(b => ['Zaloguj', 'Sign In', 'Login'].includes(b.textContent.trim()));
|
|
349
|
-
}, { timeout:
|
|
349
|
+
}, { timeout: 25000 }); // max 25s czekania
|
|
350
350
|
} catch {
|
|
351
351
|
if (this.logWarn) this.emit('warn', 'Login button not found after 15s');
|
|
352
352
|
return null;
|