homebridge-melcloud-control 2.5.0-beta.72 → 2.5.0-beta.75

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.
@@ -229,7 +229,8 @@
229
229
  "title": "Control",
230
230
  "type": "integer",
231
231
  "minimum": 0,
232
- "maximum": 2,
232
+ "maximum": 1,
233
+ "default": 0,
233
234
  "oneOf": [
234
235
  {
235
236
  "title": "None/Disabled",
@@ -240,7 +241,7 @@
240
241
  {
241
242
  "title": "Heater/Cooler",
242
243
  "enum": [
243
- 0
244
+ 1
244
245
  ]
245
246
  },
246
247
  {
@@ -293,7 +294,6 @@
293
294
  "type": "integer",
294
295
  "minimum": 0,
295
296
  "maximum": 3,
296
- "default": 1,
297
297
  "oneOf": [
298
298
  {
299
299
  "title": "None/Disabled",
@@ -617,6 +617,7 @@
617
617
  "type": "integer",
618
618
  "minimum": 0,
619
619
  "maximum": 5,
620
+ "default": 0,
620
621
  "oneOf": [
621
622
  {
622
623
  "title": "None/Disabled",
@@ -661,16 +662,15 @@
661
662
  "namePrefix": {
662
663
  "title": "Prefix",
663
664
  "type": "boolean",
665
+ "default": false,
664
666
  "description": "Enable/disable the accessory name as a prefix for button/sensor name.",
665
667
  "required": false
666
668
  }
667
669
  }
668
- },
669
- "required": false
670
+ }
670
671
  }
671
672
  }
672
- },
673
- "required": true
673
+ }
674
674
  },
675
675
  "atwDevices": {
676
676
  "title": "Devices ATW",
@@ -698,6 +698,7 @@
698
698
  "type": "integer",
699
699
  "minimum": 0,
700
700
  "maximum": 2,
701
+ "default": 1,
701
702
  "oneOf": [
702
703
  {
703
704
  "title": "None/Disabled",
@@ -708,13 +709,13 @@
708
709
  {
709
710
  "title": "Heater/Cooler",
710
711
  "enum": [
711
- 0
712
+ 1
712
713
  ]
713
714
  },
714
715
  {
715
716
  "title": "Thermostat",
716
717
  "enum": [
717
- 1
718
+ 2
718
719
  ]
719
720
  }
720
721
  ],
@@ -951,6 +952,7 @@
951
952
  "type": "integer",
952
953
  "minimum": 0,
953
954
  "maximum": 5,
955
+ "default": 0,
954
956
  "oneOf": [
955
957
  {
956
958
  "title": "None/Disabled",
@@ -995,16 +997,15 @@
995
997
  "namePrefix": {
996
998
  "title": "Prefix",
997
999
  "type": "boolean",
1000
+ "default": false,
998
1001
  "description": "Enable/disable the accessory name as a prefix for button/sensor name.",
999
1002
  "required": false
1000
1003
  }
1001
1004
  }
1002
- },
1003
- "required": false
1005
+ }
1004
1006
  }
1005
1007
  }
1006
- },
1007
- "required": true
1008
+ }
1008
1009
  },
1009
1010
  "ervDevices": {
1010
1011
  "title": "Devices ERV",
@@ -1032,6 +1033,7 @@
1032
1033
  "type": "integer",
1033
1034
  "minimum": 0,
1034
1035
  "maximum": 2,
1036
+ "default": 0,
1035
1037
  "oneOf": [
1036
1038
  {
1037
1039
  "title": "None/Disabled",
@@ -1042,13 +1044,13 @@
1042
1044
  {
1043
1045
  "title": "Heater/Cooler",
1044
1046
  "enum": [
1045
- 0
1047
+ 1
1046
1048
  ]
1047
1049
  },
1048
1050
  {
1049
1051
  "title": "Thermostat",
1050
1052
  "enum": [
1051
- 1
1053
+ 2
1052
1054
  ]
1053
1055
  }
1054
1056
  ],
@@ -1195,6 +1197,7 @@
1195
1197
  "type": "integer",
1196
1198
  "minimum": 0,
1197
1199
  "maximum": 5,
1200
+ "default": 0,
1198
1201
  "oneOf": [
1199
1202
  {
1200
1203
  "title": "None/Disabled",
@@ -1234,21 +1237,20 @@
1234
1237
  }
1235
1238
  ],
1236
1239
  "description": "Select the characteristic type to be displayed in HomeKit app.",
1237
- "required": false
1240
+ "required": true
1238
1241
  },
1239
1242
  "namePrefix": {
1240
1243
  "title": "Prefix",
1241
1244
  "type": "boolean",
1245
+ "default": false,
1242
1246
  "description": "Enable/disable the accessory name as a prefix for button/sensor name.",
1243
1247
  "required": false
1244
1248
  }
1245
1249
  }
1246
- },
1247
- "required": false
1250
+ }
1248
1251
  }
1249
1252
  }
1250
- },
1251
- "required": true
1253
+ }
1252
1254
  },
1253
1255
  "refreshInterval": {
1254
1256
  "title": "Account Refresh Interval",
@@ -161,67 +161,77 @@
161
161
  const accountKeys = Object.keys(pluginConfig[0].accounts[this.deviceIndex]);
162
162
 
163
163
  //devices ata
164
- const deviceAta = {
165
- name: deviceName,
166
- id: deviceId,
167
- type: deviceType,
168
- displayMode: 0,
169
- heatDryFanMode: 0,
170
- coolDryFanMode: 0,
171
- autoDryFanMode: 0,
172
- presets: false,
173
- temperatureSensor: false,
174
- temperatureSensorOutdoor: false,
175
- buttonsSensors: []
164
+ if (deviceType === 0) {
165
+ const deviceAta = {
166
+ name: deviceName,
167
+ id: deviceId,
168
+ type: deviceType,
169
+ displayMode: 0,
170
+ heatDryFanMode: 0,
171
+ coolDryFanMode: 0,
172
+ autoDryFanMode: 0,
173
+ presets: false,
174
+ temperatureSensor: false,
175
+ temperatureSensorOutdoor: false,
176
+ buttonsSensors: []
177
+ };
178
+
179
+ const ataDevicesExist = pluginConfig[0].accounts[this.deviceIndex].ataDevices ?? false;
180
+ const ataDevices = ataDevicesExist ? pluginConfig[0].accounts[this.deviceIndex].ataDevices : pluginConfig[0].accounts[this.deviceIndex].ataDevices = [];
181
+ const ataDeviceIdExist = ataDevices.some(device => device.id === deviceId);
182
+ const pushTypeAta = ataDeviceIdExist ? false : ataDevices.push(deviceAta);
183
+ const pushNewDevice = ataDeviceIdExist ? false : newDevices.push(deviceId);
176
184
  };
177
- const ataDevices = accountKeys.includes('ataDevices') ? pluginConfig[0].accounts[this.deviceIndex].ataDevices : pluginConfig[0].accounts[this.deviceIndex].ataDevices = [];
178
- const ataDeviceIdExist = ataDevices.some(device => device.id === deviceId)
179
- const pushTypeAta = deviceType === 0 && !ataDeviceIdExist ? ataDevices.push(deviceAta) : false;
180
185
 
181
186
  //devices atw
182
- const deviceAtw = {
183
- name: deviceName,
184
- id: deviceId,
185
- type: deviceType,
186
- displayMode: 0,
187
- temperatureSensor: false,
188
- temperatureSensorFlow: false,
189
- temperatureSensorReturn: false,
190
- temperatureSensorFlowZone1: false,
191
- temperatureSensorReturnZone1: false,
192
- temperatureSensorFlowWaterTank: false,
193
- temperatureSensorReturnWaterTank: false,
194
- temperatureSensorFlowZone2: false,
195
- temperatureSensorReturnZone2: false,
196
- presets: false,
197
- temperatureSensor: false,
198
- temperatureSensorOutdoor: false,
199
- buttonsSensors: []
187
+ if (deviceType === 1) {
188
+ const deviceAtw = {
189
+ name: deviceName,
190
+ id: deviceId,
191
+ type: deviceType,
192
+ displayMode: 0,
193
+ temperatureSensor: false,
194
+ temperatureSensorFlow: false,
195
+ temperatureSensorReturn: false,
196
+ temperatureSensorFlowZone1: false,
197
+ temperatureSensorReturnZone1: false,
198
+ temperatureSensorFlowWaterTank: false,
199
+ temperatureSensorReturnWaterTank: false,
200
+ temperatureSensorFlowZone2: false,
201
+ temperatureSensorReturnZone2: false,
202
+ presets: false,
203
+ temperatureSensor: false,
204
+ temperatureSensorOutdoor: false,
205
+ buttonsSensors: []
206
+ };
207
+ const atwDevicesExist = pluginConfig[0].accounts[this.deviceIndex].atwDevices ?? false;
208
+ const atwDevices = atwDevicesExist ? pluginConfig[0].accounts[this.deviceIndex].atwDevices : pluginConfig[0].accounts[this.deviceIndex].atwDevices = [];
209
+ const atwDeviceIdExist = atwDevices.some(device => device.id === deviceId);
210
+ const pushTypeatw = atwDeviceIdExist ? false : atwDevices.push(deviceAtw);
211
+ const pushNewDevice = atwDeviceIdExist ? false : newDevices.push(deviceId);
200
212
  };
201
- const atwDevices = accountKeys.includes('atwDevices') ? pluginConfig[0].accounts[this.deviceIndex].atwDevices : pluginConfig[0].accounts[this.deviceIndex].atwDevices = [];
202
- const atwDeviceIdExist = atwDevices.some(device => device.id === deviceId)
203
- const pushTypeAtw = deviceType === 1 && !atwDeviceIdExist ? atwDevices.push(deviceAtw) : false;
204
213
 
205
214
  //devices erv
206
- const deviceErv = {
207
- name: deviceName,
208
- id: deviceId,
209
- type: deviceType,
210
- displayMode: 0,
211
- temperatureSensor: false,
212
- temperatureSensorOutdoor: false,
213
- temperatureSensorSupply: false,
214
- presets: false,
215
- temperatureSensor: false,
216
- temperatureSensorOutdoor: false,
217
- buttonsSensors: []
215
+ if (deviceType === 3) {
216
+ const deviceErv = {
217
+ name: deviceName,
218
+ id: deviceId,
219
+ type: deviceType,
220
+ displayMode: 0,
221
+ temperatureSensor: false,
222
+ temperatureSensorOutdoor: false,
223
+ temperatureSensorSupply: false,
224
+ presets: false,
225
+ temperatureSensor: false,
226
+ temperatureSensorOutdoor: false,
227
+ buttonsSensors: []
228
+ };
229
+ const ervDevicesExist = pluginConfig[0].accounts[this.deviceIndex].ervDevices ?? false;
230
+ const ervDevices = ervDevicesExist ? pluginConfig[0].accounts[this.deviceIndex].ervDevices : pluginConfig[0].accounts[this.deviceIndex].ervDevices = [];
231
+ const ervDeviceIdExist = ervDevices.some(device => device.id === deviceId);
232
+ const pushTypeerv = ervDeviceIdExist ? false : ervDevices.push(deviceErv);
233
+ const pushNewDevice = ervDeviceIdExist ? false : newDevices.push(deviceId);
218
234
  };
219
- const ervDevices = accountKeys.includes('ervDevices') ? pluginConfig[0].accounts[this.deviceIndex].ervDevices : pluginConfig[0].accounts[this.deviceIndex].ervDevices = [];
220
- const ervDeviceIdExist = ervDevices.some(device => device.id === deviceId)
221
- const pushTypeErv = deviceType === 3 && !ervDeviceIdExist ? ervDevices.push(deviceErv) : false;
222
-
223
- //push new devices to array
224
- const pushNewDevice = ataDeviceIdExist || atwDeviceIdExist || ervDeviceIdExist ? false : newDevices.push(deviceId);
225
235
  });
226
236
 
227
237
  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.72",
4
+ "version": "2.5.0-beta.75",
5
5
  "description": "Homebridge plugin to control Mitsubishi Air Conditioner, Heat Pump and Energy Recovery Ventilation.",
6
6
  "license": "MIT",
7
7
  "author": "grzegorz914",