homebridge-melcloud-control 4.1.2-beta.42 → 4.1.2-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.
@@ -274,7 +274,8 @@
274
274
  const deviceInConfig = devicesInConfig.find(dev => String(dev.id) === device.DeviceID);
275
275
  if (deviceInConfig) {
276
276
  const idKey = account.type === 'melcloud' ? 'ID' : 'Id';
277
- const typeKey = account.type === 'melcloud' ? 'Presets' : 'Schedules';
277
+ const typeKey = account.type === 'melcloud' ? 'Presets' : 'Schedule';
278
+ const typeKey1 = account.type === 'melcloud' ? 'presets' : 'schedules';
278
279
  const presets = device[typeKey] || [];
279
280
  presets.forEach((preset, index) => {
280
281
  const presetObj = {
@@ -284,7 +285,7 @@
284
285
  namePrefix: false
285
286
  };
286
287
 
287
- const presetsInConfig = deviceInConfig.presets || [];
288
+ const presetsInConfig = deviceInConfig[typeKey1] || [];
288
289
  if (!presetsInConfig.some(pres => String(pres.id) === preset[idKey])) {
289
290
  presetsInConfig.push(presetObj);
290
291
  newPresets.push(presetObj);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "displayName": "MELCloud Control",
3
3
  "name": "homebridge-melcloud-control",
4
- "version": "4.1.2-beta.42",
4
+ "version": "4.1.2-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",