homebridge-melcloud-control 4.0.0-beta.459 → 4.0.0-beta.460
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 +8 -11
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.460",
|
|
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
|
@@ -342,17 +342,14 @@ class MelCloud extends EventEmitter {
|
|
|
342
342
|
// Now safe to navigate
|
|
343
343
|
await page.goto(ApiUrlsHome.BaseURL, { waitUntil: ['domcontentloaded', 'networkidle2'] });
|
|
344
344
|
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
}
|
|
354
|
-
if (!loginBtn) {
|
|
355
|
-
this.emit('warn', 'Login button not found');
|
|
345
|
+
let loginBtn;
|
|
346
|
+
try {
|
|
347
|
+
loginBtn = await page.waitForFunction(() => {
|
|
348
|
+
const btns = Array.from(document.querySelectorAll('button.btn--blue'));
|
|
349
|
+
return btns.find(b => ['Zaloguj', 'Sign In', 'Login'].includes(b.textContent.trim()));
|
|
350
|
+
}, { timeout: 15000 }); // max 15s czekania
|
|
351
|
+
} catch {
|
|
352
|
+
this.emit('warn', 'Login button not found after 15s');
|
|
356
353
|
return null;
|
|
357
354
|
}
|
|
358
355
|
|