homebridge-melcloud-control 3.1.0-beta.3 → 3.1.0-beta.4

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.
@@ -1706,7 +1706,7 @@
1706
1706
  {
1707
1707
  "key": "accounts[].ataDevices[].presets",
1708
1708
  "type": "tabarray",
1709
- "title": "{{ value.name || 'button/sensor' }}",
1709
+ "title": "{{ value.name }}",
1710
1710
  "items": [
1711
1711
  "accounts[].ataDevices[].presets[].name",
1712
1712
  "accounts[].ataDevices[].presets[].displayType",
@@ -1796,7 +1796,7 @@
1796
1796
  {
1797
1797
  "key": "accounts[].atwDevices[].presets",
1798
1798
  "type": "tabarray",
1799
- "title": "{{ value.name || 'button/sensor' }}",
1799
+ "title": "{{ value.name }}",
1800
1800
  "items": [
1801
1801
  "accounts[].atwDevices[].presets[].name",
1802
1802
  "accounts[].atwDevices[].presets[].displayType",
@@ -1880,7 +1880,7 @@
1880
1880
  {
1881
1881
  "key": "accounts[].ervDevices[].presets",
1882
1882
  "type": "tabarray",
1883
- "title": "{{ value.name || 'button/sensor' }}",
1883
+ "title": "{{ value.name }}",
1884
1884
  "items": [
1885
1885
  "accounts[].ervDevices[].presets[].name",
1886
1886
  "accounts[].ervDevices[].presets[].displayType",
@@ -178,12 +178,10 @@
178
178
  case 0:
179
179
  //get devices by type
180
180
  for (const device of devices) {
181
- const deviceId = device.DeviceID;
182
181
  const deviceType = device.Type;
183
-
184
182
  const pusDeviceTypeAta = deviceType === 0 ? devicesByType.ata.push(device) : false;
185
- const pusDeviceTypeAtw = deviceType === 0 ? devicesByType.atw.push(device) : false;
186
- const pusDeviceTypeErv = deviceType === 0 ? devicesByType.erv.push(device) : false;
183
+ const pusDeviceTypeAtw = deviceType === 1 ? devicesByType.atw.push(device) : false;
184
+ const pusDeviceTypeErv = deviceType === 3 ? devicesByType.erv.push(device) : false;
187
185
  };
188
186
 
189
187
  //get device info fom devices ata
@@ -192,7 +190,7 @@
192
190
  const deviceType = device.Type;
193
191
  const deviceTypeText = "Air Conditioner";
194
192
  const deviceName = device.DeviceName;
195
- const devicePresets = device.presets ?? [];
193
+ const devicePresets = device.Presets ?? [];
196
194
 
197
195
  //devices ata
198
196
  const deviceAta = {
@@ -219,7 +217,7 @@
219
217
  textAta = `ATA: ${devicesCount}`
220
218
 
221
219
  //presets
222
- devicePresets.forEach((preset, index1) => {
220
+ for (const preset of devicePresets) {
223
221
  const presetId = preset.ID;
224
222
  const presetName = preset.NumberDescription;
225
223
 
@@ -234,7 +232,7 @@
234
232
  const pushNewPreset = ataPresetIdExist ? false : newDevices.ataPresets.push(preset);
235
233
  const presetsCount = newDevices.ataPresets.length;
236
234
  textAtaPresets = `ATA Presets: ${presetsCount}`
237
- });
235
+ };
238
236
  });
239
237
 
240
238
  //get device info fom devices atw
@@ -243,7 +241,7 @@
243
241
  const deviceType = device.Type;
244
242
  const deviceTypeText = "Heat Pump";
245
243
  const deviceName = device.DeviceName;
246
- const devicePresets = device.presets ?? [];
244
+ const devicePresets = device.Presets ?? [];
247
245
 
248
246
  //devices atw
249
247
  const deviceAtw = {
@@ -275,7 +273,7 @@
275
273
  textAtw = `ATW: ${devicesCount}`
276
274
 
277
275
  //presetzs
278
- devicePresets.forEach((preset, index1) => {
276
+ for (const preset of devicePresets) {
279
277
  const presetId = preset.ID;
280
278
  const presetName = preset.NumberDescription;
281
279
 
@@ -290,7 +288,7 @@
290
288
  const pushNewPreset = atwPresetIdExist ? false : newDevices.atwPresets.push(preset);
291
289
  const presetsCount = newDevices.atwPresets.length;
292
290
  textAtwPresets = `ATW Presets: ${presetsCount}`
293
- });
291
+ };
294
292
  });
295
293
 
296
294
  //get device info fom devices erv
@@ -299,7 +297,7 @@
299
297
  const deviceType = device.Type;
300
298
  const deviceTypeText = "Energy Recovery Ventilation";
301
299
  const deviceName = device.DeviceName;
302
- const devicePresets = device.presets ?? [];
300
+ const devicePresets = device.Presets ?? [];
303
301
  const deviceErv = {
304
302
  id: deviceId,
305
303
  type: deviceType,
@@ -323,7 +321,7 @@
323
321
  textErv = `ERV: ${devicesCount}`
324
322
 
325
323
  //presets
326
- devicePresets.forEach((preset, index1) => {
324
+ for (const preset of devicePresets) {
327
325
  const presetId = preset.ID;
328
326
  const presetName = preset.NumberDescription;
329
327
 
@@ -338,14 +336,15 @@
338
336
  const pushNewPreset = ervPresetIdExist ? false : newDevices.ervPresets.push(preset);
339
337
  const presetsCount = newDevices.ervPresets.length;
340
338
  textErvPresets = `ERV Presets: ${presetsCount}`
341
- });
339
+ };
342
340
  });
343
341
 
344
342
  const newDevicesCount = newDevices.ata.length + newDevices.atw.length + newDevices.erv.length;
345
343
  const newPresetsCount = newDevices.ataPresets.length + newDevices.atwPresets.length + newDevices.ervPresets.length;
346
344
  document.getElementById('info').innerHTML = `${newDevicesCount === 0 ? 'No new devices found.' : `Found, ${textAta}, ${textAtw}, ${textErv}. ${newDevicesCount === 0 ? '' : 'Now You can start to configure it.'}`}`;
345
+ document.getElementById('info').style.color = newDevicesCount === 0 ? 'yellow' : 'green';
347
346
  document.getElementById('info1').innerHTML = `${newPresetsCount === 0 ? 'No new presets found.' : `Found, ${textAtaPresets}, ${textAtwPresets}, ${textErvPresets}. ${newPresetsCount === 0 ? '' : 'Now You can start to configure it.'}`}`;
348
- document.getElementById('info').style.color = 'green';
347
+ document.getElementById('info1').style.color = newPresetsCount === 0 ? 'yellow' : 'green';
349
348
 
350
349
  await homebridge.updatePluginConfig(pluginConfig);
351
350
  await homebridge.savePluginConfig(pluginConfig);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "displayName": "MELCloud Control",
3
3
  "name": "homebridge-melcloud-control",
4
- "version": "3.1.0-beta.3",
4
+ "version": "3.1.0-beta.4",
5
5
  "description": "Homebridge plugin to control Mitsubishi Air Conditioner, Heat Pump and Energy Recovery Ventilation.",
6
6
  "license": "MIT",
7
7
  "author": "grzegorz914",