homebridge-melcloud-control 2.5.0-beta.31 → 2.5.0-beta.33

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.
@@ -205,8 +205,120 @@
205
205
  "description": "Here select the language used in MELCloud account.",
206
206
  "required": true
207
207
  },
208
- "devices": {
209
- "title": "Devices",
208
+ "devicesAta": {
209
+ "title": "Devices ATA",
210
+ "type": "array",
211
+ "items": {
212
+ "type": "object",
213
+ "properties": {
214
+ "name": {
215
+ "title": "Name",
216
+ "type": "string",
217
+ "required": true
218
+ },
219
+ "id": {
220
+ "title": "Mode",
221
+ "type": "integer",
222
+ "description": "Device ID.",
223
+ "required": true
224
+ },
225
+ "type": {
226
+ "title": "Type",
227
+ "type": "integer",
228
+ "description": "Device Type.",
229
+ "required": true
230
+ },
231
+ "displayMode": {
232
+ "title": "Control",
233
+ "type": "integer",
234
+ "minimum": 0,
235
+ "maximum": 2,
236
+ "default": 0,
237
+ "oneOf": [
238
+ {
239
+ "title": "None/Disabled",
240
+ "enum": [
241
+ 0
242
+ ]
243
+ },
244
+ {
245
+ "title": "Heater/Cooler",
246
+ "enum": [
247
+ 0
248
+ ]
249
+ },
250
+ {
251
+ "title": "Thermostat",
252
+ "enum": [
253
+ 1
254
+ ]
255
+ }
256
+ ],
257
+ "description": "Select device control mode displayed in HomeKit app.",
258
+ "required": true
259
+ }
260
+ }
261
+ },
262
+ "required": false
263
+ },
264
+ "devicesAtw": {
265
+ "title": "Devices ATA",
266
+ "type": "array",
267
+ "items": {
268
+ "type": "object",
269
+ "properties": {
270
+ "name": {
271
+ "title": "Name",
272
+ "type": "string",
273
+ "required": true
274
+ },
275
+ "id": {
276
+ "title": "Mode",
277
+ "type": "integer",
278
+ "description": "Device ID.",
279
+ "required": true
280
+ },
281
+ "type": {
282
+ "title": "Type",
283
+ "type": "integer",
284
+ "description": "Device Type.",
285
+ "required": true
286
+ },
287
+ "displayMode": {
288
+ "title": "Control",
289
+ "type": "integer",
290
+ "minimum": 0,
291
+ "maximum": 2,
292
+ "default": 0,
293
+ "oneOf": [
294
+ {
295
+ "title": "None/Disabled",
296
+ "enum": [
297
+ 0
298
+ ]
299
+ },
300
+ {
301
+ "title": "Heater/Cooler",
302
+ "enum": [
303
+ 0
304
+ ]
305
+ },
306
+ {
307
+ "title": "Thermostat",
308
+ "enum": [
309
+ 1
310
+ ]
311
+ }
312
+ ],
313
+ "description": "Select device control mode displayed in HomeKit app.",
314
+ "required": true
315
+ }
316
+ }
317
+ },
318
+ "required": false
319
+ },
320
+ "devicesErv": {
321
+ "title": "Devices ATA",
210
322
  "type": "array",
211
323
  "items": {
212
324
  "type": "object",
@@ -83,7 +83,7 @@
83
83
  const setRemoveAtribute = j === i ? document.getElementById(`button${j}`).setAttribute("class", "btn btn-secondary") : document.getElementById(`button${j}`).setAttribute("class", "btn btn-primary");
84
84
  }
85
85
 
86
- const devicesCount = pluginConfig[0].accounts[this.deviceIndex].devices.length ?? 0;
86
+ const devicesCount = pluginConfig[0].accounts[i].devicesAta.length ?? 0;
87
87
  document.getElementById('info').innerHTML = `MELCloud configured ${devicesCount} ${devicesCount} ${devicesCount !== 1 ? 'devices' : 'device'}.`;
88
88
  document.getElementById('accountName').innerHTML = pluginConfig[0].accounts[i].name || '';
89
89
  document.getElementById('name').value = pluginConfig[0].accounts[i].name || '';
@@ -162,7 +162,9 @@
162
162
 
163
163
  const displayMode = pluginConfig[0].accounts[this.deviceIndex].devices[index].displayMode ?? 0;
164
164
  const device = { name: deviceName, id: deviceId, type: deviceType, displayMode: displayMode };
165
- const language = pluginConfig[0].accounts[this.deviceIndex].devices.push(device);
165
+ const push = deviceType === 0 ? pluginConfig[0].accounts[this.deviceIndex].devicesAta.push(device) : false;
166
+ const push1 = deviceType === 1 ? pluginConfig[0].accounts[this.deviceIndex].devicesAtw.push(device) : false;
167
+ const push2 = deviceType === 3 ? pluginConfig[0].accounts[this.deviceIndex].devicesErv.push(device) : false;
166
168
  });
167
169
 
168
170
  await homebridge.updatePluginConfig(pluginConfig);
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.31",
4
+ "version": "2.5.0-beta.33",
5
5
  "description": "Homebridge plugin to control Mitsubishi Air Conditioner, Heat Pump and Energy Recovery Ventilation.",
6
6
  "license": "MIT",
7
7
  "author": "grzegorz914",