homebridge-melcloud-control 4.0.0-beta.16 → 4.0.0-beta.17
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 -15
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.17",
|
|
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
|
@@ -214,23 +214,13 @@ class MelCloud extends EventEmitter {
|
|
|
214
214
|
}
|
|
215
215
|
|
|
216
216
|
async connectHomeCookies() {
|
|
217
|
-
const loginUrl = new URL('https://live-melcloudhome.auth.eu-west-1.amazoncognito.com/login');
|
|
218
|
-
loginUrl.searchParams.set('client_id', '3g4d5l5kivuqi7oia68gib7uso');
|
|
219
|
-
loginUrl.searchParams.set('redirect_uri', 'https://auth.melcloudhome.com/signin-oidc-meu');
|
|
220
|
-
loginUrl.searchParams.set('response_type', 'code');
|
|
221
|
-
loginUrl.searchParams.set('scope', 'openid profile');
|
|
222
|
-
loginUrl.searchParams.set('response_mode', 'form_post');
|
|
223
|
-
|
|
224
|
-
const browser = await puppeteer.launch({
|
|
225
|
-
headless: true,
|
|
226
|
-
args: ['--no-sandbox', '--disable-setuid-sandbox']
|
|
227
|
-
});
|
|
228
|
-
|
|
229
|
-
const page = await browser.newPage();
|
|
230
|
-
|
|
231
217
|
try {
|
|
218
|
+
const loginUrl = 'https://melcloudhome.com';
|
|
219
|
+
const browser = await puppeteer.launch({ headless: true, args: ['--no-sandbox', '--disable-setuid-sandbox'] });
|
|
220
|
+
const page = await browser.newPage();
|
|
221
|
+
|
|
232
222
|
this.emit('warn', 'Opening login page...');
|
|
233
|
-
await page.goto(loginUrl
|
|
223
|
+
await page.goto(loginUrl, { waitUntil: 'networkidle2' });
|
|
234
224
|
|
|
235
225
|
this.emit('warn', 'Typing credentials...');
|
|
236
226
|
await page.type('input[name="username"]', this.user, { delay: 50 });
|