homebridge-melcloud-control 4.0.0-beta.283 → 4.0.0-beta.284
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 -3
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.284",
|
|
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
|
@@ -299,13 +299,12 @@ class MelCloud extends EventEmitter {
|
|
|
299
299
|
await page.waitForSelector('input[name="username"]', { timeout: 5000 });
|
|
300
300
|
await page.type('input[name="username"]', this.user, { delay: 50 });
|
|
301
301
|
await page.type('input[name="password"]', this.passwd, { delay: 50 });
|
|
302
|
-
const button1 = await page.$('input[
|
|
302
|
+
const button1 = await page.$('input[type="Submit"]');
|
|
303
303
|
await Promise.all([button1.click(), page.waitForNavigation({ waitUntil: 'networkidle2', timeout: 10000 })]);
|
|
304
304
|
|
|
305
305
|
let authCode = null;
|
|
306
306
|
const start = Date.now();
|
|
307
307
|
const timeout = 30000; // 30s
|
|
308
|
-
console.log('Authorization code:', page);
|
|
309
308
|
|
|
310
309
|
while (!authCode && Date.now() - start < timeout) {
|
|
311
310
|
authCode = await page.evaluate(() => {
|
|
@@ -314,7 +313,8 @@ class MelCloud extends EventEmitter {
|
|
|
314
313
|
});
|
|
315
314
|
if (!authCode) await new Promise(r => setTimeout(r, 200));
|
|
316
315
|
}
|
|
317
|
-
|
|
316
|
+
console.log('Authorization code:', page);
|
|
317
|
+
console.log('Authorization code1:', window.location.href);
|
|
318
318
|
if (!authCode) {
|
|
319
319
|
throw new Error('Authorization code not found in URL');
|
|
320
320
|
}
|