homebridge-melcloud-control 3.8.8-beta.0 → 3.8.8

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 +12 -13
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -115,7 +115,7 @@ class MelCloudPlatform {
115
115
  return;
116
116
  }
117
117
 
118
- //start impulse generator
118
+ //start account impulse generator
119
119
  await melCloud.impulseGenerator.start([{ name: 'checkDevicesList', sampling: refreshInterval }]);
120
120
 
121
121
  //configured devices
@@ -123,9 +123,8 @@ class MelCloudPlatform {
123
123
  const atwDevices = account.atwDevices ?? [];
124
124
  const ervDevices = account.ervDevices ?? [];
125
125
  const devices = [...ataDevices, ...atwDevices, ...ervDevices];
126
- const emitLog = !enableDebugMode ? false : log.info(`Found configured devices: ${devices.length}.`);
126
+ const emitLog = !enableDebugMode ? false : log.info(`Found configured devices ATA: ${ataDevices.length}, ATW: ${atwDevices.length}, ERV: ${ervDevices.length}.`);
127
127
  for (const device of devices) {
128
-
129
128
  //chack device from config exist on melcloud
130
129
  const deviceId = device.id;
131
130
  const displayMode = device.displayMode > 0;
@@ -139,27 +138,27 @@ class MelCloudPlatform {
139
138
  const deviceTypeText = device.typeString;
140
139
  const deviceRefreshInterval = device.refreshInterval * 1000 || 5000;
141
140
  try {
142
- let configureddDevice;
141
+ let configuredDevice;
143
142
  switch (deviceType) {
144
143
  case 0: //ATA
145
- configureddDevice = new DeviceAta(api, account, device, contextKey, accountName, deviceId, deviceName, deviceTypeText, devicesFile, deviceRefreshInterval, useFahrenheit, restFul, mqtt);
144
+ configuredDevice = new DeviceAta(api, account, device, contextKey, accountName, deviceId, deviceName, deviceTypeText, devicesFile, deviceRefreshInterval, useFahrenheit, restFul, mqtt);
146
145
  break;
147
146
  case 1: //ATW
148
- configureddDevice = new DeviceAtw(api, account, device, contextKey, accountName, deviceId, deviceName, deviceTypeText, devicesFile, deviceRefreshInterval, useFahrenheit, restFul, mqtt);
147
+ configuredDevice = new DeviceAtw(api, account, device, contextKey, accountName, deviceId, deviceName, deviceTypeText, devicesFile, deviceRefreshInterval, useFahrenheit, restFul, mqtt);
149
148
  break;
150
149
  case 2:
151
150
  break;
152
151
  case 3: //ERV
153
- configureddDevice = new DeviceErv(api, account, device, contextKey, accountName, deviceId, deviceName, deviceTypeText, devicesFile, deviceRefreshInterval, useFahrenheit, restFul, mqtt);
152
+ configuredDevice = new DeviceErv(api, account, device, contextKey, accountName, deviceId, deviceName, deviceTypeText, devicesFile, deviceRefreshInterval, useFahrenheit, restFul, mqtt);
154
153
  break;
155
154
  default:
156
- const emitLog = disableLogWarn ? false : log.warn(`${accountName}, ${deviceTypeText} ${deviceName}, unknown device: ${deviceType}.`);
155
+ const emitLog = disableLogWarn ? false : log.warn(`${accountName}, ${deviceTypeText}, ${deviceName}, unknown device: ${deviceType}.`);
157
156
  return;
158
157
  }
159
158
 
160
- configureddDevice.on('publishAccessory', (accessory) => {
159
+ configuredDevice.on('publishAccessory', (accessory) => {
161
160
  api.publishExternalAccessories(PluginName, [accessory]);
162
- const emitLog = disableLogSuccess ? false : log.success(`${accountName}, ${deviceTypeText} ${deviceName}, published as external accessory.`);
161
+ const emitLog = disableLogSuccess ? false : log.success(`${accountName}, ${deviceTypeText}, ${deviceName}, published as external accessory.`);
163
162
  })
164
163
  .on('melCloud', async (key, value) => {
165
164
  try {
@@ -192,11 +191,11 @@ class MelCloudPlatform {
192
191
  const impulseGenerator = new ImpulseGenerator();
193
192
  impulseGenerator.on('start', async () => {
194
193
  try {
195
- const startDone = await configureddDevice.start();
194
+ const startDone = await configuredDevice.start();
196
195
  const stopImpulseGenerator = startDone ? await impulseGenerator.stop() : false;
197
196
 
198
197
  //start impulse generator
199
- const startImpulseGenerator = stopImpulseGenerator ? await configureddDevice.startImpulseGenerator() : false
198
+ const startImpulseGenerator = stopImpulseGenerator ? await configuredDevice.startImpulseGenerator() : false
200
199
  } catch (error) {
201
200
  const emitLog = disableLogError ? false : log.error(`${accountName}, ${deviceTypeText}, ${deviceName}, ${error}, trying again.`);
202
201
  }
@@ -211,7 +210,7 @@ class MelCloudPlatform {
211
210
  }
212
211
  }
213
212
  } catch (error) {
214
- const emitLog = disableLogError ? false : log.error(`${accountName}, Account did finish launching error: ${error}.`);
213
+ const emitLog = disableLogError ? false : log.error(`${accountName}, did finish launching error: ${error}.`);
215
214
  }
216
215
  }
217
216
  });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "displayName": "MELCloud Control",
3
3
  "name": "homebridge-melcloud-control",
4
- "version": "3.8.8-beta.0",
4
+ "version": "3.8.8",
5
5
  "description": "Homebridge plugin to control Mitsubishi Air Conditioner, Heat Pump and Energy Recovery Ventilation.",
6
6
  "license": "MIT",
7
7
  "author": "grzegorz914",