homebridge-melcloud-control 4.0.0-beta.487 → 4.0.0-beta.489
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 +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.489",
|
|
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
|
@@ -318,7 +318,7 @@ class MelCloud extends EventEmitter {
|
|
|
318
318
|
});
|
|
319
319
|
|
|
320
320
|
// Wait for Puppeteer target to be ready (browser internal page)
|
|
321
|
-
await new Promise(r => setTimeout(r,
|
|
321
|
+
await new Promise(r => setTimeout(r, 1000));
|
|
322
322
|
|
|
323
323
|
// Defensive check for main frame availability
|
|
324
324
|
this.emit('warn', `Test 2`);
|
|
@@ -330,7 +330,7 @@ class MelCloud extends EventEmitter {
|
|
|
330
330
|
}
|
|
331
331
|
|
|
332
332
|
// Ensure page is ready
|
|
333
|
-
await new Promise(r => setTimeout(r,
|
|
333
|
+
await new Promise(r => setTimeout(r, 1000));
|
|
334
334
|
|
|
335
335
|
this.emit('warn', `Test 3`);
|
|
336
336
|
page.on('error', err => { if (this.logError) this.emit('error', `Page crashed: ${err.message}`); });
|
|
@@ -345,19 +345,20 @@ class MelCloud extends EventEmitter {
|
|
|
345
345
|
this.emit('warn', `Test 4`);
|
|
346
346
|
await page.goto(ApiUrlsHome.BaseURL, { waitUntil: ['domcontentloaded', 'networkidle2'] });
|
|
347
347
|
|
|
348
|
+
await new Promise(r => setTimeout(r, 3000));
|
|
348
349
|
let loginBtn;
|
|
349
350
|
try {
|
|
350
351
|
this.emit('warn', `Test 5`);
|
|
351
352
|
loginBtn = await page.waitForFunction(() => {
|
|
352
353
|
const btns = Array.from(document.querySelectorAll('button.btn--blue'));
|
|
354
|
+
this.emit('warn', `Test 5.1 ${btns}`);
|
|
353
355
|
return btns.find(b => ['Zaloguj', 'Sign In', 'Login'].includes(b.textContent.trim()));
|
|
354
356
|
}, { timeout: 5000 }); // max 5s czekania
|
|
355
|
-
this.emit('warn', `Test 5.1`);
|
|
356
357
|
} catch {
|
|
357
358
|
if (this.logWarn) this.emit('warn', 'Login button not found after 5s');
|
|
358
359
|
return null;
|
|
359
360
|
}
|
|
360
|
-
this.emit('warn', `Test 5.2
|
|
361
|
+
this.emit('warn', `Test 5.2`);
|
|
361
362
|
|
|
362
363
|
await Promise.race([
|
|
363
364
|
Promise.all([loginBtn.click(), page.waitForNavigation({ waitUntil: ['domcontentloaded', 'networkidle2'], timeout: 15000 })]),
|