homebridge-melcloud-control 2.5.0-beta.41 → 2.5.0-beta.43

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.
@@ -156,13 +156,18 @@
156
156
  const deviceType = deviceInfo.Type;
157
157
  const deviceId = deviceInfo.DeviceID;
158
158
  const deviceName = deviceInfo.DeviceName;
159
- const deviceIdExist = pluginConfig[0].accounts[this.deviceIndex].ataDevices.some(device => device.type === deviceId)
160
- const pushNewDevice = !deviceIdExist ? newDevices.push(deviceId) : false;
159
+ const ataDevices = pluginConfig[0].accounts[this.deviceIndex].ataDevices;
160
+ const atwDevices = pluginConfig[0].accounts[this.deviceIndex].atwDevices;
161
+ const ervDevices = pluginConfig[0].accounts[this.deviceIndex].ervDevices;
162
+ const ataDeviceIdExist = ataDevices.some(device => device.id === deviceId)
163
+ const atwDeviceIdExist = atwDevices.some(device => device.id === deviceId)
164
+ const ervDeviceIdExist = ervDevices.some(device => device.id === deviceId)
165
+ const pushNewDevice = !ataDeviceIdExist || !atwDeviceIdExist || !ervDeviceIdExist ? newDevices.push(deviceId) : false;
161
166
 
162
167
  const device = { name: deviceName, id: deviceId, type: deviceType, displayMode: 0 };
163
- const pushTypeAta = deviceType === 0 && !deviceIdExist ? pluginConfig[0].accounts[this.deviceIndex].ataDevices.push(device) : false;
164
- const pushTypeAtw = deviceType === 1 && !deviceIdExist ? pluginConfig[0].accounts[this.deviceIndex].atwDevices.push(device) : false;
165
- const pushTypeErv = deviceType === 3 && !deviceIdExist ? pluginConfig[0].accounts[this.deviceIndex].ervDevices.push(device) : false;
168
+ const pushTypeAta = deviceType === 0 && !ataDeviceIdExist ? ataDevices.push(device) : false;
169
+ const pushTypeAtw = deviceType === 1 && !atwDeviceIdExist ? atwDevices.push(device) : false;
170
+ const pushTypeErv = deviceType === 3 && !ervDeviceIdExist ? ervDevices.push(device) : false;
166
171
  });
167
172
 
168
173
  const devicesCount = newDevices.length;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "displayName": "MELCloud Control",
3
3
  "name": "homebridge-melcloud-control",
4
- "version": "2.5.0-beta.41",
4
+ "version": "2.5.0-beta.43",
5
5
  "description": "Homebridge plugin to control Mitsubishi Air Conditioner, Heat Pump and Energy Recovery Ventilation.",
6
6
  "license": "MIT",
7
7
  "author": "grzegorz914",