homebridge-melcloud-control 4.0.0-beta.535 → 4.0.0-beta.536
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/index.js +1 -1
- package/package.json +1 -1
- package/src/melcloud.js +6 -10
package/index.js
CHANGED
|
@@ -199,7 +199,7 @@ class MelCloudPlatform {
|
|
|
199
199
|
if (logLevel.success) log.success(`${accountName}, ${deviceTypeText}, ${deviceName}, Published as external accessory.`);
|
|
200
200
|
|
|
201
201
|
//start impulse generators\
|
|
202
|
-
const timmers = accountType === 'melcloudhome' ? [{ name: 'connect', sampling:
|
|
202
|
+
const timmers = accountType === 'melcloudhome' ? [{ name: 'connect', sampling: 3000000 }, { name: 'checkDevicesList', sampling: deviceRefreshInterval }] : [{ name: 'checkDevicesList', sampling: refreshInterval }];
|
|
203
203
|
await melCloud.impulseGenerator.state(true, timmers, false);
|
|
204
204
|
await configuredDevice.startStopImpulseGenerator(true, [{ name: 'checkState', sampling: deviceRefreshInterval }]);
|
|
205
205
|
|
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.536",
|
|
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
|
@@ -344,8 +344,10 @@ class MelCloud extends EventEmitter {
|
|
|
344
344
|
]
|
|
345
345
|
});
|
|
346
346
|
|
|
347
|
-
const context = await browser.
|
|
347
|
+
const context = await browser.newContext();
|
|
348
348
|
const page = await context.newPage();
|
|
349
|
+
await page.goto('about:blank');
|
|
350
|
+
await context.clearCookies();
|
|
349
351
|
page.setDefaultTimeout(GLOBAL_TIMEOUT);
|
|
350
352
|
page.setDefaultNavigationTimeout(GLOBAL_TIMEOUT);
|
|
351
353
|
|
|
@@ -402,6 +404,7 @@ class MelCloud extends EventEmitter {
|
|
|
402
404
|
|
|
403
405
|
this.emit('warn', `Found submit button ${submitButton}`);
|
|
404
406
|
await Promise.race([Promise.all([submitButton.click(), page.waitForNavigation({ waitUntil: ['domcontentloaded', 'networkidle2'], timeout: GLOBAL_TIMEOUT / 4 })]), new Promise(r => setTimeout(r, GLOBAL_TIMEOUT / 3))]);
|
|
407
|
+
await new Promise(r => setTimeout(r, 2000));
|
|
405
408
|
|
|
406
409
|
this.emit('warn', `Looking for cookies...`);
|
|
407
410
|
// Extract cookies
|
|
@@ -438,15 +441,8 @@ class MelCloud extends EventEmitter {
|
|
|
438
441
|
throw new Error(`Connect error: ${error.message}`);
|
|
439
442
|
} finally {
|
|
440
443
|
if (browser) {
|
|
441
|
-
try {
|
|
442
|
-
|
|
443
|
-
for (const ctx of contexts) {
|
|
444
|
-
await ctx.close().catch(() => { });
|
|
445
|
-
}
|
|
446
|
-
await browser.close();
|
|
447
|
-
} catch (closeErr) {
|
|
448
|
-
this.emit('error', `Failed to close Puppeteer: ${closeErr.message}`);
|
|
449
|
-
}
|
|
444
|
+
try { await browser.close(); }
|
|
445
|
+
catch (closeErr) { this.emit('error', `Failed to close Puppeteer: ${closeErr.message}`); }
|
|
450
446
|
}
|
|
451
447
|
}
|
|
452
448
|
}
|