homebridge-melcloud-control 4.0.0-beta.495 → 4.0.0-beta.496

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.
@@ -23,8 +23,8 @@ class PluginUiServer extends HomebridgePluginUiServer {
23
23
  const accountInfo = await melCloud.connect();
24
24
  if (!accountInfo.State) return accountInfo;
25
25
 
26
- const devices = await melCloud.checkDevicesList();
27
- return devices;
26
+ const devicesList = await melCloud.checkDevicesList();
27
+ return devicesList;
28
28
  } catch (error) {
29
29
  throw new Error(`MELCloud error: ${error.message ?? error}.`);
30
30
  };
package/index.js CHANGED
@@ -106,7 +106,7 @@ class MelCloudPlatform {
106
106
  }
107
107
 
108
108
  if (!accountInfo.State) {
109
- if (logLevel.warn) log.warn(`${accountName}, Connect not possible: ${accountInfo.Info}`);
109
+ if (logLevel.warn) log.warn(`${accountName}, ${accountInfo.Info}`);
110
110
  return;
111
111
  }
112
112
 
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.495",
4
+ "version": "4.0.0-beta.496",
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
@@ -175,7 +175,6 @@ class MelCloud extends EventEmitter {
175
175
  if (this.logDebug) this.emit('debug', `MELCloud Info: ${JSON.stringify(debugData, null, 2)}`);
176
176
 
177
177
  if (!contextKey) {
178
- if (this.logWarn) this.emit('warn', `Context key missing`);
179
178
  accountInfo.State = false;
180
179
  accountInfo.Info = 'Context key missing'
181
180
  return accountInfo;
@@ -308,7 +307,6 @@ class MelCloud extends EventEmitter {
308
307
  const accountInfo = { State: false, Info: '', ContextKey: null, UseFahrenheit: false }
309
308
  const chromiumPath = await this.functions.ensureChromiumInstalled();
310
309
  if (!chromiumPath) {
311
- if (this.logWarn) this.emit('warn', 'Chromium not found on Your device, please install it manually and try again');
312
310
  accountInfo.State = false;
313
311
  accountInfo.Info = 'Chromium not found on Your device, please install it manually and try again'
314
312
  return accountInfo;
@@ -363,7 +361,6 @@ class MelCloud extends EventEmitter {
363
361
  return btns.find(b => ['Zaloguj', 'Sign In', 'Login'].includes(b.textContent.trim()));
364
362
  }, { timeout: 5000 }); // max 5s czekania
365
363
  } catch {
366
- if (this.logWarn) this.emit('warn', 'Login button not found after 5s');
367
364
  accountInfo.State = false;
368
365
  accountInfo.Info = 'Login button not found after 5s';
369
366
  return accountInfo;
@@ -375,7 +372,6 @@ class MelCloud extends EventEmitter {
375
372
  const usernameInput = await page.$('input[name="username"]');
376
373
  const passwordInput = await page.$('input[name="password"]');
377
374
  if (!usernameInput || !passwordInput) {
378
- if (this.logWarn) this.emit('warn', 'Username or password input not found');
379
375
  accountInfo.State = false;
380
376
  accountInfo.Info = 'Username or password input not found';
381
377
  return accountInfo;
@@ -388,7 +384,6 @@ class MelCloud extends EventEmitter {
388
384
  this.emit('warn', `Test 8`);
389
385
  const submitButton = await page.$('input[type="submit"], button[type="submit"]');
390
386
  if (!submitButton) {
391
- if (this.logWarn) this.emit('warn', 'Submit button not found on login form');
392
387
  accountInfo.State = false;
393
388
  accountInfo.Info = 'Submit button not found on login form';
394
389
  return accountInfo;
@@ -408,7 +403,6 @@ class MelCloud extends EventEmitter {
408
403
 
409
404
  this.emit('warn', `Test 10`);
410
405
  if (!c1 || !c2) {
411
- if (this.logWarn) this.emit('warn', 'Cookies C1/C2 missing after login');
412
406
  accountInfo.State = false;
413
407
  accountInfo.Info = 'Cookies C1/C2 missing';
414
408
  return accountInfo;