homebridge-melcloud-control 4.2.5-beta.15 → 4.2.5-beta.16

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "displayName": "MELCloud Control",
3
3
  "name": "homebridge-melcloud-control",
4
- "version": "4.2.5-beta.15",
4
+ "version": "4.2.5-beta.16",
5
5
  "description": "Homebridge plugin to control Mitsubishi Air Conditioner, Heat Pump and Energy Recovery Ventilation.",
6
6
  "license": "MIT",
7
7
  "author": "grzegorz914",
@@ -321,28 +321,10 @@ class MelCloud extends EventEmitter {
321
321
  }
322
322
  await Promise.race([Promise.all([submitButton.click(), page.waitForNavigation({ waitUntil: ['domcontentloaded', 'networkidle2'], timeout: GLOBAL_TIMEOUT / 4 })]), new Promise(r => setTimeout(r, GLOBAL_TIMEOUT / 3))]);
323
323
  await page.goto(ApiUrlsHome.GetConfiguration, { waitUntil: ['domcontentloaded', 'networkidle2'], timeout: GLOBAL_TIMEOUT / 3 });
324
- this.emit('warn', `Cookies: ${JSON.stringify(await page.browserContext().cookies())}`);
325
-
326
- // Extract cookies
327
- let c1 = null, c2 = null;
328
- const start = Date.now();
329
- while ((!c1 || !c2) && Date.now() - start < GLOBAL_TIMEOUT / 2) {
330
- const cookies = await browser.cookies();
331
- c1 = cookies.find(c => c.name === '__Secure-monitorandcontrolC1')?.value || c1;
332
- c2 = cookies.find(c => c.name === '__Secure-monitorandcontrolC2')?.value || c2;
333
- if (!c1 || !c2) await new Promise(r => setTimeout(r, 500));
334
- }
324
+ const cookies = await page.browserContext().cookies();
325
+ this.emit('warn', `Cookies: ${JSON.stringify(cookies)}`);
335
326
 
336
- if (!c1 || !c2) {
337
- accountInfo.Info = 'Cookies C1/C2 missing';
338
- return accountInfo;
339
- }
340
327
 
341
- const cookies = [
342
- '__Secure-monitorandcontrol=chunks-2',
343
- `__Secure-monitorandcontrolC1=${c1}`,
344
- `__Secure-monitorandcontrolC2=${c2}`
345
- ].join('; ');
346
328
 
347
329
 
348
330
  const userAgent = await page.evaluate(() => navigator.userAgent);