homebridge-melcloud-control 4.3.4-beta.2 → 4.3.4-beta.3

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 CHANGED
@@ -110,29 +110,29 @@ class MelCloudPlatform {
110
110
  let accountInfo;
111
111
  try {
112
112
  accountInfo = await configureAccount.connect();
113
+ if (!accountInfo.State) {
114
+ if (logLevel.warn) log.warn(`${accountName}, ${accountInfo.Info}`);
115
+ return;
116
+ }
113
117
  } catch (error) {
114
118
  if (logLevel.error) log.error(`${accountName}, Connect error: ${error.message ?? error}`);
115
119
  return;
116
120
  }
117
-
118
- if (!accountInfo.State) {
119
- if (logLevel.warn) log.warn(`${accountName}, ${accountInfo.Info}`);
120
- return;
121
- }
122
121
  if (logLevel.success) log.success(accountInfo.Info);
123
122
 
124
123
  //check devices list
125
124
  let devicesList;
126
125
  try {
127
126
  devicesList = await configureAccount.checkDevicesList();
127
+ if (!devicesList.State) {
128
+ if (logLevel.warn) log.warn(`${accountName}, ${devicesList.Info}`);
129
+ return;
130
+ }
128
131
  } catch (error) {
129
132
  if (logLevel.error) log.error(`${accountName}, Check devices list error: ${error.message ?? error}`);
130
133
  return;
131
134
  }
132
- if (!devicesList.State) {
133
- if (logLevel.warn) log.warn(`${accountName}, ${devicesList.Info}`);
134
- return;
135
- }
135
+ if (logLevel.debug) log.info(devicesList.Info);
136
136
 
137
137
  //configured devices
138
138
  const ataDevices = (account.ataDevices || []).filter(device => device.id != null && String(device.id) !== '0');
@@ -171,7 +171,7 @@ class MelCloudPlatform {
171
171
  if (logLevel.debug) log.debug(`Default temperature file created: ${defaultTempsFile}`);
172
172
  }
173
173
  } catch (error) {
174
- if (logLevel.error) log.error(`Device: ${host} ${deviceName}, File init error: ${error.message}`);
174
+ if (logLevel.error) log.error(`${accountName}, ${deviceTypeString}, ${deviceName}, File init error: ${error.message}`);
175
175
  continue;
176
176
  }
177
177
  }
@@ -211,7 +211,7 @@ class MelCloudPlatform {
211
211
  }
212
212
  }
213
213
 
214
- //start melcloud impulse generator
214
+ //start account impulse generator
215
215
  await configureAccount.impulseGenerator.state(true, timmers, false);
216
216
 
217
217
  //stop start impulse generator
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "displayName": "MELCloud Control",
3
3
  "name": "homebridge-melcloud-control",
4
- "version": "4.3.4-beta.2",
4
+ "version": "4.3.4-beta.3",
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
@@ -97,7 +97,6 @@ class MelCloud extends EventEmitter {
97
97
  device.DeviceID = String(device.DeviceID);
98
98
  });
99
99
 
100
- if (this.logDebug) this.emit('debug', `Found ${allDevices.length} devices in building: ${building.Name || 'Unnamed'}`);
101
100
  devices.push(...allDevices);
102
101
  }
103
102