homebridge-melcloud-control 3.1.1-beta.0 → 3.1.1-beta.2

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/index.js +18 -18
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -72,10 +72,25 @@ class MelCloudPlatform {
72
72
  const refreshInterval = account.refreshInterval * 1000 || 120000;
73
73
  const deviceRefreshInterval = account.deviceRefreshInterval * 1000 || 5000;
74
74
 
75
- //melcloud account
76
- const melCloud = new MelCloud(user, passwd, language, accountInfoFile, buildingsFile, deviceFile, enableDebugMode, refreshInterval, false);
77
-
78
75
  try {
76
+ //melcloud account
77
+ const melCloud = new MelCloud(user, passwd, language, accountInfoFile, buildingsFile, deviceFile, enableDebugMode, refreshInterval, false);
78
+ melCloud.on('success', (message) => {
79
+ log.success(`Account ${accountName}, ${message}`);
80
+ })
81
+ .on('message', (message) => {
82
+ log.info(`Account ${accountName}, ${message}`);
83
+ })
84
+ .on('debug', (debug) => {
85
+ log.info(`Account ${accountName}, debug: ${debug}`);
86
+ })
87
+ .on('warn', (warn) => {
88
+ log.warn(`Account ${accountName}, ${warn}`);
89
+ })
90
+ .on('error', (error) => {
91
+ log.error(`Account ${accountName}, ${error}.`);
92
+ });
93
+
79
94
  //connect
80
95
  const response = await melCloud.connect();
81
96
  const accountInfo = response.accountInfo;
@@ -200,21 +215,6 @@ class MelCloudPlatform {
200
215
  log.error(`${deviceTypeText}, ${deviceName}, ${error}`);
201
216
  });
202
217
  };
203
- melCloud.on('success', (message) => {
204
- log.success(`Account ${accountName}, ${message}`);
205
- })
206
- .on('message', (message) => {
207
- log.info(`Account ${accountName}, ${message}`);
208
- })
209
- .on('debug', (debug) => {
210
- log.info(`Account ${accountName}, debug: ${debug}`);
211
- })
212
- .on('warn', (warn) => {
213
- log.warn(`Account ${accountName}, ${warn}`);
214
- })
215
- .on('error', (error) => {
216
- log.error(`Account ${accountName}, ${error}.`);
217
- });
218
218
  } catch (error) {
219
219
  log.error(`Account: ${accountName}, MELCloud error: ${error.message ?? error}`);
220
220
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "displayName": "MELCloud Control",
3
3
  "name": "homebridge-melcloud-control",
4
- "version": "3.1.1-beta.0",
4
+ "version": "3.1.1-beta.2",
5
5
  "description": "Homebridge plugin to control Mitsubishi Air Conditioner, Heat Pump and Energy Recovery Ventilation.",
6
6
  "license": "MIT",
7
7
  "author": "grzegorz914",