homebridge-melcloud-control 4.0.0-beta.512 → 4.0.0-beta.513
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 +3 -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.513",
|
|
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
|
@@ -366,8 +366,7 @@ class MelCloud extends EventEmitter {
|
|
|
366
366
|
try {
|
|
367
367
|
loginBtn = await page.waitForFunction(() => {
|
|
368
368
|
const btns = Array.from(document.querySelectorAll('button.btn--blue'));
|
|
369
|
-
btns.find(b => ['Zaloguj', 'Sign In', 'Login'].includes(b.textContent.trim()));
|
|
370
|
-
return btns;
|
|
369
|
+
return btns.find(b => ['Zaloguj', 'Sign In', 'Login'].includes(b.textContent.trim()));
|
|
371
370
|
}, { timeout: GLOBAL_TIMEOUT / 6 });
|
|
372
371
|
} catch {
|
|
373
372
|
accountInfo.State = false;
|
|
@@ -375,8 +374,8 @@ class MelCloud extends EventEmitter {
|
|
|
375
374
|
return accountInfo;
|
|
376
375
|
}
|
|
377
376
|
|
|
377
|
+
this.emit('warn', `Found login button ${loginBtn}`);
|
|
378
378
|
await Promise.race([Promise.all([loginBtn.click(), page.waitForNavigation({ waitUntil: ['domcontentloaded', 'networkidle2'], timeout: GLOBAL_TIMEOUT / 4 })]), new Promise(r => setTimeout(r, GLOBAL_TIMEOUT / 3))]);
|
|
379
|
-
this.emit('warn', `Found login button`);
|
|
380
379
|
|
|
381
380
|
this.emit('warn', `Looking for credentials form...`);
|
|
382
381
|
const usernameInput = await page.$('input[name="username"]');
|
|
@@ -399,8 +398,8 @@ class MelCloud extends EventEmitter {
|
|
|
399
398
|
return accountInfo;
|
|
400
399
|
}
|
|
401
400
|
|
|
402
|
-
await Promise.race([Promise.all([submitButton.click(), page.waitForNavigation({ waitUntil: ['domcontentloaded', 'networkidle2'], timeout: GLOBAL_TIMEOUT / 4 })]), new Promise(r => setTimeout(r, GLOBAL_TIMEOUT / 3))]);
|
|
403
401
|
this.emit('warn', `Found submit button ${submitButton}`);
|
|
402
|
+
await Promise.race([Promise.all([submitButton.click(), page.waitForNavigation({ waitUntil: ['domcontentloaded', 'networkidle2'], timeout: GLOBAL_TIMEOUT / 4 })]), new Promise(r => setTimeout(r, GLOBAL_TIMEOUT / 3))]);
|
|
404
403
|
|
|
405
404
|
this.emit('warn', `Looking for cookies...`);
|
|
406
405
|
// Extract cookies
|