homebridge-melcloud-control 4.0.0-beta.292 → 4.0.0-beta.293
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 +0 -10
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.293",
|
|
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
|
@@ -301,16 +301,6 @@ class MelCloud extends EventEmitter {
|
|
|
301
301
|
await page.type('input[name="password"]', this.passwd, { delay: 50 });
|
|
302
302
|
const button1 = await page.$('input[type="submit"]');
|
|
303
303
|
await Promise.all([button1.click(), page.waitForNavigation({ waitUntil: 'networkidle2', timeout: 10000 })]);
|
|
304
|
-
|
|
305
|
-
// 1️⃣ Sprawdzenie, czy code jest w URL
|
|
306
|
-
const url1 = page.url();
|
|
307
|
-
const urlMatch = url1.match(/[?&]code=([^&]+)/);
|
|
308
|
-
if (urlMatch) {
|
|
309
|
-
console.log('Authorization code found in URL');
|
|
310
|
-
return urlMatch[1];
|
|
311
|
-
}
|
|
312
|
-
|
|
313
|
-
// 2️⃣ Jeśli nie w URL, sprawdź body HTML (form_post)
|
|
314
304
|
const html = await page.content(html);
|
|
315
305
|
const code = await melCloudHomeToken.extractCodeFromHtml();
|
|
316
306
|
|