homebridge-melcloud-control 4.0.0-beta.512 → 4.0.0-beta.514

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 +2 -2
  2. package/src/melcloud.js +3 -4
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.512",
4
+ "version": "4.0.0-beta.514",
5
5
  "description": "Homebridge plugin to control Mitsubishi Air Conditioner, Heat Pump and Energy Recovery Ventilation.",
6
6
  "license": "MIT",
7
7
  "author": "grzegorz914",
@@ -32,7 +32,7 @@
32
32
  ],
33
33
  "engines": {
34
34
  "homebridge": "^1.9.0 || ^2.0.0 || ^2.0.0-beta.30 || ^2.0.0-alpha.60",
35
- "node": "^20 || ^22 || ^24"
35
+ "node": "^20 || ^22 || ^24 || ^25"
36
36
  },
37
37
  "dependencies": {
38
38
  "@homebridge/plugin-ui-utils": "^2.1.0",
package/src/melcloud.js CHANGED
@@ -366,8 +366,7 @@ class MelCloud extends EventEmitter {
366
366
  try {
367
367
  loginBtn = await page.waitForFunction(() => {
368
368
  const btns = Array.from(document.querySelectorAll('button.btn--blue'));
369
- btns.find(b => ['Zaloguj', 'Sign In', 'Login'].includes(b.textContent.trim()));
370
- return btns;
369
+ return btns.find(b => ['Zaloguj', 'Sign In', 'Login'].includes(b.textContent.trim()));
371
370
  }, { timeout: GLOBAL_TIMEOUT / 6 });
372
371
  } catch {
373
372
  accountInfo.State = false;
@@ -375,8 +374,8 @@ class MelCloud extends EventEmitter {
375
374
  return accountInfo;
376
375
  }
377
376
 
377
+ this.emit('warn', `Found login button ${loginBtn}`);
378
378
  await Promise.race([Promise.all([loginBtn.click(), page.waitForNavigation({ waitUntil: ['domcontentloaded', 'networkidle2'], timeout: GLOBAL_TIMEOUT / 4 })]), new Promise(r => setTimeout(r, GLOBAL_TIMEOUT / 3))]);
379
- this.emit('warn', `Found login button`);
380
379
 
381
380
  this.emit('warn', `Looking for credentials form...`);
382
381
  const usernameInput = await page.$('input[name="username"]');
@@ -399,8 +398,8 @@ class MelCloud extends EventEmitter {
399
398
  return accountInfo;
400
399
  }
401
400
 
402
- await Promise.race([Promise.all([submitButton.click(), page.waitForNavigation({ waitUntil: ['domcontentloaded', 'networkidle2'], timeout: GLOBAL_TIMEOUT / 4 })]), new Promise(r => setTimeout(r, GLOBAL_TIMEOUT / 3))]);
403
401
  this.emit('warn', `Found submit button ${submitButton}`);
402
+ await Promise.race([Promise.all([submitButton.click(), page.waitForNavigation({ waitUntil: ['domcontentloaded', 'networkidle2'], timeout: GLOBAL_TIMEOUT / 4 })]), new Promise(r => setTimeout(r, GLOBAL_TIMEOUT / 3))]);
404
403
 
405
404
  this.emit('warn', `Looking for cookies...`);
406
405
  // Extract cookies