homebridge-melcloud-control 2.5.0-beta.36 → 2.5.0-beta.38

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.
@@ -214,27 +214,18 @@
214
214
  "name": {
215
215
  "title": "Name",
216
216
  "type": "string",
217
- "default": "",
218
- "required": true
217
+ "required": false
219
218
  },
220
219
  "id": {
221
220
  "title": "ID",
222
221
  "type": "integer",
223
- "default": 0,
224
- "required": true
225
- },
226
- "type": {
227
- "title": "Type",
228
- "type": "integer",
229
- "default": 0,
230
- "required": true
222
+ "required": false
231
223
  },
232
224
  "displayMode": {
233
225
  "title": "Control",
234
226
  "type": "integer",
235
227
  "minimum": 0,
236
228
  "maximum": 2,
237
- "default": 0,
238
229
  "oneOf": [
239
230
  {
240
231
  "title": "None/Disabled",
@@ -263,7 +254,7 @@
263
254
  "required": false
264
255
  },
265
256
  "devicesAtw": {
266
- "title": "Devices ATA",
257
+ "title": "Devices ATW",
267
258
  "type": "array",
268
259
  "items": {
269
260
  "type": "object",
@@ -271,19 +262,17 @@
271
262
  "name": {
272
263
  "title": "Name",
273
264
  "type": "string",
274
- "required": true
265
+ "required": false
275
266
  },
276
267
  "id": {
277
268
  "title": "Mode",
278
269
  "type": "integer",
279
- "description": "Device ID.",
280
- "required": true
270
+ "required": false
281
271
  },
282
272
  "type": {
283
273
  "title": "Type",
284
274
  "type": "integer",
285
- "description": "Device Type.",
286
- "required": true
275
+ "required": false
287
276
  },
288
277
  "displayMode": {
289
278
  "title": "Control",
@@ -319,7 +308,7 @@
319
308
  "required": false
320
309
  },
321
310
  "devicesErv": {
322
- "title": "Devices ATA",
311
+ "title": "Devices ERV",
323
312
  "type": "array",
324
313
  "items": {
325
314
  "type": "object",
@@ -327,19 +316,17 @@
327
316
  "name": {
328
317
  "title": "Name",
329
318
  "type": "string",
330
- "required": true
319
+ "required": false
331
320
  },
332
321
  "id": {
333
322
  "title": "Mode",
334
323
  "type": "integer",
335
- "description": "Device ID.",
336
- "required": true
324
+ "required": false
337
325
  },
338
326
  "type": {
339
327
  "title": "Type",
340
328
  "type": "integer",
341
- "description": "Device Type.",
342
- "required": true
329
+ "required": false
343
330
  },
344
331
  "displayMode": {
345
332
  "title": "Control",
@@ -1582,39 +1569,6 @@
1582
1569
  "type": "password"
1583
1570
  },
1584
1571
  "accounts[].language",
1585
- {
1586
- "key": "accounts[].devicesAta",
1587
- "type": "tabarray",
1588
- "title": "{{ value.name }}",
1589
- "items": [
1590
- "accounts[].devicesAta[].name",
1591
- "accounts[].devicesAta[].id",
1592
- "accounts[].devicesAta[].type",
1593
- "accounts[].devicesAta[].displayMode"
1594
- ]
1595
- },
1596
- {
1597
- "key": "accounts[].devicesAtw",
1598
- "type": "tabarray",
1599
- "title": "{{ value.name }}",
1600
- "items": [
1601
- "accounts[].devicesAtw[].name",
1602
- "accounts[].devicesAtw[].id",
1603
- "accounts[].devicesAtw[].type",
1604
- "accounts[].devicesAtw[].displayMode"
1605
- ]
1606
- },
1607
- {
1608
- "key": "accounts[].devicesErv",
1609
- "type": "tabarray",
1610
- "title": "{{ value.name }}",
1611
- "items": [
1612
- "accounts[].devicesErv[].name",
1613
- "accounts[].devicesErv[].id",
1614
- "accounts[].devicesErv[].type",
1615
- "accounts[].devicesErv[].displayMode"
1616
- ]
1617
- },
1618
1572
  {
1619
1573
  "key": "accounts[]",
1620
1574
  "type": "section",
@@ -1631,6 +1585,17 @@
1631
1585
  "key": "accounts[]",
1632
1586
  "title": "Air Conditioner",
1633
1587
  "items": [
1588
+ {
1589
+ "key": "accounts[].devicesAta",
1590
+ "type": "tabarray",
1591
+ "title": "{{ value.name }}",
1592
+ "items": [
1593
+ "accounts[].devicesAta[].name",
1594
+ "accounts[].devicesAta[].id",
1595
+ "accounts[].devicesAta[].type",
1596
+ "accounts[].devicesAta[].displayMode"
1597
+ ]
1598
+ },
1634
1599
  "accounts[].ataDisplayMode",
1635
1600
  "accounts[].ataPresets",
1636
1601
  {
@@ -1700,6 +1665,17 @@
1700
1665
  "key": "accounts[]",
1701
1666
  "title": "Heat Pump",
1702
1667
  "items": [
1668
+ {
1669
+ "key": "accounts[].devicesAtw",
1670
+ "type": "tabarray",
1671
+ "title": "{{ value.name }}",
1672
+ "items": [
1673
+ "accounts[].devicesAtw[].name",
1674
+ "accounts[].devicesAtw[].id",
1675
+ "accounts[].devicesAtw[].type",
1676
+ "accounts[].devicesAtw[].displayMode"
1677
+ ]
1678
+ },
1703
1679
  "accounts[].atwDisplayMode",
1704
1680
  "accounts[].atwPresets",
1705
1681
  {
@@ -1764,6 +1740,17 @@
1764
1740
  "key": "accounts[]",
1765
1741
  "title": "Energy Recovery Ventilation",
1766
1742
  "items": [
1743
+ {
1744
+ "key": "accounts[].devicesErv",
1745
+ "type": "tabarray",
1746
+ "title": "{{ value.name }}",
1747
+ "items": [
1748
+ "accounts[].devicesErv[].name",
1749
+ "accounts[].devicesErv[].id",
1750
+ "accounts[].devicesErv[].type",
1751
+ "accounts[].devicesErv[].displayMode"
1752
+ ]
1753
+ },
1767
1754
  "accounts[].ervDisplayMode",
1768
1755
  "accounts[].ervPresets",
1769
1756
  {
@@ -147,6 +147,9 @@
147
147
  const info = response.info ?? '';
148
148
  const status = response.status;
149
149
  const devices = response.data ?? [];
150
+ const typeAta = [];
151
+ const typeAtw = [];
152
+ const typeErv = [];
150
153
 
151
154
  switch (status) {
152
155
  case 0:
@@ -160,13 +163,16 @@
160
163
  const deviceId = deviceInfo.DeviceID;
161
164
  const deviceName = deviceInfo.DeviceName;
162
165
 
163
- const displayMode = pluginConfig[0].accounts[this.deviceIndex].devicesAta[index].displayMode ?? 0;
164
- const device = { name: deviceName, id: deviceId, type: deviceType, displayMode: displayMode };
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
+ const device = { name: deviceName, id: deviceId, type: deviceType, displayMode: 0 };
167
+ const pushTypeAta = deviceType === 0 ? typeAta.push(device) : false;
168
+ const pushTypeAtw = deviceType === 1 ? typeAtw.push(device) : false;
169
+ const pushTypeErv = deviceType === 3 ? typeErv.push(device) : false;
168
170
  });
169
171
 
172
+ pluginConfig[0].accounts[this.deviceIndex].devicesAta = typeAta;
173
+ pluginConfig[0].accounts[this.deviceIndex].devicesAtw = typeAtw;
174
+ pluginConfig[0].accounts[this.deviceIndex].devicesErv = typeErv;
175
+
170
176
  await homebridge.updatePluginConfig(pluginConfig);
171
177
  await homebridge.savePluginConfig(pluginConfig);
172
178
  break;
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.36",
4
+ "version": "2.5.0-beta.38",
5
5
  "description": "Homebridge plugin to control Mitsubishi Air Conditioner, Heat Pump and Energy Recovery Ventilation.",
6
6
  "license": "MIT",
7
7
  "author": "grzegorz914",