homebridge-melcloud-control 4.0.0-beta.480 → 4.0.0-beta.482

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/melcloud.js +6 -6
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.480",
4
+ "version": "4.0.0-beta.482",
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
@@ -325,8 +325,7 @@ class MelCloud extends EventEmitter {
325
325
  const pages = await browser.pages();
326
326
  let page = pages[0];
327
327
  if (!page) {
328
- this.emit('warn', `Test 13`);
329
- if (this.logDebug) this.emit('debug', 'No initial page found, creating a new one.');
328
+ if (this.logWarn) this.emit('warn', 'No initial page found, creating a new one.');
330
329
  page = await browser.newPage();
331
330
  }
332
331
 
@@ -348,17 +347,18 @@ class MelCloud extends EventEmitter {
348
347
 
349
348
  let loginBtn;
350
349
  try {
350
+ this.emit('warn', `Test 5`);
351
351
  loginBtn = await page.waitForFunction(() => {
352
352
  const btns = Array.from(document.querySelectorAll('button.btn--blue'));
353
- this.emit('warn', `Test 5`);
353
+ this.emit('warn', `Test 5.1`);
354
354
  return btns.find(b => ['Zaloguj', 'Sign In', 'Login'].includes(b.textContent.trim()));
355
- }, { timeout: 25000 }); // max 25s czekania
355
+ }, { timeout: 10000 }); // max 10s czekania
356
356
  } catch {
357
- if (this.logWarn) this.emit('warn', 'Login button not found after 15s');
357
+ if (this.logWarn) this.emit('warn', 'Login button not found after 10s');
358
358
  return null;
359
359
  }
360
+ this.emit('warn', `Test 5.2 ${loginBtn}`);
360
361
 
361
- this.emit('warn', `Test 6`);
362
362
  await Promise.race([
363
363
  Promise.all([loginBtn.click(), page.waitForNavigation({ waitUntil: ['domcontentloaded', 'networkidle2'], timeout: 15000 })]),
364
364
  new Promise(r => setTimeout(r, 12000))