homebridge-melcloud-control 3.8.0-beta.2 → 3.8.0-beta.21

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.
@@ -833,7 +833,7 @@
833
833
  "title": "Hide zone",
834
834
  "type": "integer",
835
835
  "minimum": 0,
836
- "maximum": 7,
836
+ "maximum": 13,
837
837
  "default": 0,
838
838
  "oneOf": [
839
839
  {
@@ -843,46 +843,82 @@
843
843
  ]
844
844
  },
845
845
  {
846
- "title": "Zone 1",
846
+ "title": "Heat Pump",
847
847
  "enum": [
848
848
  1
849
849
  ]
850
850
  },
851
851
  {
852
- "title": "Zone 2",
852
+ "title": "Heat Pump / Zone 1",
853
853
  "enum": [
854
854
  2
855
855
  ]
856
856
  },
857
857
  {
858
- "title": "Zone 1/2",
858
+ "title": "Heat Pump / Zone 1 / Hot Water",
859
859
  "enum": [
860
860
  3
861
861
  ]
862
862
  },
863
863
  {
864
- "title": "Hot Water",
864
+ "title": "Heat Pump / Zone 1 / Zone 2",
865
865
  "enum": [
866
866
  4
867
867
  ]
868
868
  },
869
869
  {
870
- "title": "Zone 1/Hot Water",
870
+ "title": "Heat Pump / Hot Water",
871
871
  "enum": [
872
872
  5
873
873
  ]
874
874
  },
875
875
  {
876
- "title": "Zone 2/Hot Water",
876
+ "title": "Heat Pump / Hot Water / Zone 2",
877
877
  "enum": [
878
878
  6
879
879
  ]
880
880
  },
881
881
  {
882
- "title": "Zone 1/2/Hot Water",
882
+ "title": "Zone 1",
883
883
  "enum": [
884
884
  7
885
885
  ]
886
+ },
887
+ {
888
+ "title": "Zone 1 / Hot Water",
889
+ "enum": [
890
+ 8
891
+ ]
892
+ },
893
+ {
894
+ "title": "Zone 1 / Hot Water / Zone 2",
895
+ "enum": [
896
+ 9
897
+ ]
898
+ },
899
+ {
900
+ "title": "Hot Water",
901
+ "enum": [
902
+ 10
903
+ ]
904
+ },
905
+ {
906
+ "title": "Hot Water / Zone 2",
907
+ "enum": [
908
+ 11
909
+ ]
910
+ },
911
+ {
912
+ "title": "Zone 2",
913
+ "enum": [
914
+ 12
915
+ ]
916
+ },
917
+ {
918
+ "title": "All",
919
+ "enum": [
920
+ 13
921
+ ]
886
922
  }
887
923
  ],
888
924
  "description": "Select which zone need to be hidden in HomeKit app, if present.",
@@ -1865,7 +1901,19 @@
1865
1901
  }
1866
1902
  ]
1867
1903
  }
1868
- ]
1904
+ ],
1905
+ "condition": {
1906
+ "functionBody": "return model.accounts[arrayIndices].ataDevices.length > 0;"
1907
+ }
1908
+ },
1909
+ {
1910
+ "key": "accounts[]",
1911
+ "type": "tabarray",
1912
+ "title": "{{ value.title }}",
1913
+ "items": [],
1914
+ "condition": {
1915
+ "functionBody": "return model.accounts[arrayIndices].ataDevices.length === 0;"
1916
+ }
1869
1917
  }
1870
1918
  ]
1871
1919
  },
@@ -1887,6 +1935,7 @@
1887
1935
  "readonly": true
1888
1936
  },
1889
1937
  "accounts[].atwDevices[].displayMode",
1938
+ "accounts[].atwDevices[].hideZone",
1890
1939
  {
1891
1940
  "key": "accounts[].atwDevices[]",
1892
1941
  "type": "section",
@@ -1895,7 +1944,6 @@
1895
1944
  "expanded": false,
1896
1945
  "items": [
1897
1946
  "accounts[].atwDevices[].name",
1898
- "accounts[].atwDevices[].hideZone",
1899
1947
  "accounts[].atwDevices[].refreshInterval"
1900
1948
  ]
1901
1949
  },
@@ -1960,7 +2008,19 @@
1960
2008
  }
1961
2009
  ]
1962
2010
  }
1963
- ]
2011
+ ],
2012
+ "condition": {
2013
+ "functionBody": "return model.accounts[arrayIndices].atwDevices.length > 0;"
2014
+ }
2015
+ },
2016
+ {
2017
+ "key": "accounts[]",
2018
+ "type": "tabarray",
2019
+ "title": "{{ value.title }}",
2020
+ "items": [],
2021
+ "condition": {
2022
+ "functionBody": "return model.accounts[arrayIndices].atwDevices.length === 0;"
2023
+ }
1964
2024
  }
1965
2025
  ]
1966
2026
  },
@@ -2048,7 +2108,19 @@
2048
2108
  }
2049
2109
  ]
2050
2110
  }
2051
- ]
2111
+ ],
2112
+ "condition": {
2113
+ "functionBody": "return model.accounts[arrayIndices].ervDevices.length > 0;"
2114
+ }
2115
+ },
2116
+ {
2117
+ "key": "accounts[]",
2118
+ "type": "tabarray",
2119
+ "title": "{{ value.title }}",
2120
+ "items": [],
2121
+ "condition": {
2122
+ "functionBody": "return model.accounts[arrayIndices].ervDevices.length === 0;"
2123
+ }
2052
2124
  }
2053
2125
  ]
2054
2126
  }
package/index.js CHANGED
@@ -169,7 +169,7 @@ class MelCloudPlatform {
169
169
  const stopImpulseGenerator = startDone ? await impulseGenerator.stop() : false;
170
170
 
171
171
  //start impulse generator
172
- const startImpulseGenerator = startDone ? await airConditioner.startImpulseGenerator() : false
172
+ const startImpulseGenerator = stopImpulseGenerator ? await airConditioner.startImpulseGenerator() : false
173
173
  } catch (error) {
174
174
  const emitLog = disableLogError ? false : log.error(`${accountName}, ${deviceTypeText}, ${deviceName}, ${error}, trying again.`);
175
175
  };
@@ -235,7 +235,7 @@ class MelCloudPlatform {
235
235
  const stopImpulseGenerator = startDone ? await impulseGenerator.stop() : false;
236
236
 
237
237
  //start impulse generator
238
- const startImpulseGenerator = startDone ? await heatPump.startImpulseGenerator() : false
238
+ const startImpulseGenerator = stopImpulseGenerator ? await heatPump.startImpulseGenerator() : false
239
239
  } catch (error) {
240
240
  const emitLog = disableLogError ? false : log.error(`${accountName}, ${deviceTypeText}, ${deviceName}, ${error}, trying again.`);
241
241
  };
@@ -247,7 +247,7 @@ class MelCloudPlatform {
247
247
  await impulseGenerator.start([{ name: 'start', sampling: 45000 }]);
248
248
  };
249
249
  } catch (error) {
250
- const emitLog = disableLogError ? false : log.error(`${accountName}, ATE did finish launching error: ${error}.`);
250
+ const emitLog = disableLogError ? false : log.error(`${accountName}, ATW did finish launching error: ${error}.`);
251
251
  }
252
252
 
253
253
  //Energy Recovery Ventilation 3
@@ -301,7 +301,7 @@ class MelCloudPlatform {
301
301
  const stopImpulseGenerator = startDone ? await impulseGenerator.stop() : false;
302
302
 
303
303
  //start impulse generator
304
- const startImpulseGenerator = startDone ? await energyRecoveryVentilation.startImpulseGenerator() : false
304
+ const startImpulseGenerator = stopImpulseGenerator ? await energyRecoveryVentilation.startImpulseGenerator() : false
305
305
  } catch (error) {
306
306
  const emitLog = disableLogError ? false : log.error(`${accountName}, ${deviceTypeText}, ${deviceName}, ${error}, trying again.`);
307
307
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "displayName": "MELCloud Control",
3
3
  "name": "homebridge-melcloud-control",
4
- "version": "3.8.0-beta.2",
4
+ "version": "3.8.0-beta.21",
5
5
  "description": "Homebridge plugin to control Mitsubishi Air Conditioner, Heat Pump and Energy Recovery Ventilation.",
6
6
  "license": "MIT",
7
7
  "author": "grzegorz914",
package/src/deviceata.js CHANGED
@@ -249,6 +249,7 @@ class DeviceAta extends EventEmitter {
249
249
  async startImpulseGenerator() {
250
250
  try {
251
251
  //start impule generator
252
+ await new Promise(resolve => setTimeout(resolve, 1000));
252
253
  await this.melCloudAta.impulseGenerator.start([{ name: 'checkState', sampling: this.refreshInterval }]);
253
254
  return true;
254
255
  } catch (error) {
@@ -971,7 +972,7 @@ class DeviceAta extends EventEmitter {
971
972
  this.firmwareRevision = firmwareAppVersion;
972
973
  this.displayDeviceInfo = false;
973
974
  })
974
- .on('deviceState', (deviceData) => {
975
+ .on('deviceState', async (deviceData) => {
975
976
  this.deviceData = deviceData;
976
977
 
977
978
  //presets
@@ -1369,6 +1370,13 @@ class DeviceAta extends EventEmitter {
1369
1370
  this.emit('message', `Temperature display unit: ${this.accessory.temperatureUnit}`);
1370
1371
  this.emit('message', `Lock physical controls: ${this.accessory.lockPhysicalControl ? 'LOCKED' : 'UNLOCKED'}`);
1371
1372
  };
1373
+
1374
+ //prepare accessory
1375
+ if (this.startPrepareAccessory) {
1376
+ const accessory = await this.prepareAccessory(this.accountInfo, deviceData, this.deviceId, this.deviceTypeText, this.deviceName, this.accountName);
1377
+ this.emit('publishAccessory', accessory);
1378
+ this.startPrepareAccessory = false;
1379
+ }
1372
1380
  })
1373
1381
  .on('success', (success) => {
1374
1382
  this.emit('success', success);
@@ -1396,18 +1404,7 @@ class DeviceAta extends EventEmitter {
1396
1404
  const startExternalIntegrations = this.restFul.enable || this.mqtt.enable ? await this.externalIntegrations() : false;
1397
1405
 
1398
1406
  //check state
1399
- const deviceData = await this.melCloudAta.checkState();
1400
-
1401
- if (deviceData === false) {
1402
- return null;
1403
- }
1404
-
1405
- //prepare accessory
1406
- if (this.startPrepareAccessory) {
1407
- const accessory = await this.prepareAccessory(this.accountInfo, deviceData, this.deviceId, this.deviceTypeText, this.deviceName, this.accountName);
1408
- this.emit('publishAccessory', accessory);
1409
- this.startPrepareAccessory = false;
1410
- }
1407
+ await this.melCloudAta.checkState();
1411
1408
 
1412
1409
  return true;
1413
1410
  } catch (error) {