homebridge-melcloud-control 4.0.0-beta.17 → 4.0.0-beta.18
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 -9
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.18",
|
|
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
|
@@ -222,6 +222,9 @@ class MelCloud extends EventEmitter {
|
|
|
222
222
|
this.emit('warn', 'Opening login page...');
|
|
223
223
|
await page.goto(loginUrl, { waitUntil: 'networkidle2' });
|
|
224
224
|
|
|
225
|
+
// Poczekaj, aż strona przekieruje do Cognito login
|
|
226
|
+
await page.waitForSelector('input[name="username"]', { timeout: 15000 });
|
|
227
|
+
|
|
225
228
|
this.emit('warn', 'Typing credentials...');
|
|
226
229
|
await page.type('input[name="username"]', this.user, { delay: 50 });
|
|
227
230
|
await page.type('input[name="password"]', this.passwd, { delay: 50 });
|
|
@@ -233,15 +236,6 @@ class MelCloud extends EventEmitter {
|
|
|
233
236
|
page.waitForNavigation({ waitUntil: 'networkidle2', timeout: 20000 })
|
|
234
237
|
]);
|
|
235
238
|
|
|
236
|
-
// Obsługa ewentualnego "Stay signed in?"
|
|
237
|
-
const staySignedInBtn = await page.$('input[type="submit"]');
|
|
238
|
-
if (staySignedInBtn) {
|
|
239
|
-
await Promise.all([
|
|
240
|
-
staySignedInBtn.click(),
|
|
241
|
-
page.waitForNavigation({ waitUntil: 'networkidle2', timeout: 20000 })
|
|
242
|
-
]);
|
|
243
|
-
}
|
|
244
|
-
|
|
245
239
|
let c1 = null, c2 = null;
|
|
246
240
|
const start = Date.now();
|
|
247
241
|
|