homebridge-melcloud-control 4.0.0-beta.556 → 4.0.0-beta.559

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.
@@ -395,6 +395,12 @@
395
395
  "default": false,
396
396
  "description": "This enable extra outdoor temperature sensor to use with automations in HomeKit app."
397
397
  },
398
+ "errorSensor": {
399
+ "title": "Error",
400
+ "type": "boolean",
401
+ "default": false,
402
+ "description": "This enable error sensor to use with automations in HomeKit app."
403
+ },
398
404
  "refreshInterval": {
399
405
  "title": "Refresh Interval",
400
406
  "type": "integer",
@@ -1004,6 +1010,12 @@
1004
1010
  "default": false,
1005
1011
  "description": "This enable extra Return Zone 2 temperature sensor to use with automations in HomeKit app."
1006
1012
  },
1013
+ "errorSensor": {
1014
+ "title": "Error",
1015
+ "type": "boolean",
1016
+ "default": false,
1017
+ "description": "This enable error sensor to use with automations in HomeKit app."
1018
+ },
1007
1019
  "refreshInterval": {
1008
1020
  "title": "Refresh Interval",
1009
1021
  "type": "integer",
@@ -1391,6 +1403,12 @@
1391
1403
  "default": false,
1392
1404
  "description": "This enable extra supply temperature sensor to use with automations in HomeKit app."
1393
1405
  },
1406
+ "errorSensor": {
1407
+ "title": "Error",
1408
+ "type": "boolean",
1409
+ "default": false,
1410
+ "description": "This enable error sensor to use with automations in HomeKit app."
1411
+ },
1394
1412
  "refreshInterval": {
1395
1413
  "title": "Refresh Interval",
1396
1414
  "type": "integer",
@@ -1868,19 +1886,6 @@
1868
1886
  "functionBody": "return model.accounts[arrayIndices[0]].ataDevices[arrayIndices[1]].displayType > 0;"
1869
1887
  }
1870
1888
  },
1871
- {
1872
- "title": "Temperature Sensors",
1873
- "type": "section",
1874
- "expandable": true,
1875
- "expanded": false,
1876
- "items": [
1877
- "accounts[].ataDevices[].temperatureSensor",
1878
- "accounts[].ataDevices[].temperatureSensorOutdoor"
1879
- ],
1880
- "condition": {
1881
- "functionBody": "return model.accounts[arrayIndices[0]].ataDevices[arrayIndices[1]].displayType > 0;"
1882
- }
1883
- },
1884
1889
  {
1885
1890
  "title": "Presets",
1886
1891
  "type": "section",
@@ -1912,6 +1917,17 @@
1912
1917
  "expandable": true,
1913
1918
  "expanded": false,
1914
1919
  "items": [
1920
+ "accounts[].ataDevices[].errorSensor",
1921
+ {
1922
+ "title": "Temperature Sensors",
1923
+ "type": "section",
1924
+ "expandable": true,
1925
+ "expanded": false,
1926
+ "items": [
1927
+ "accounts[].ataDevices[].temperatureSensor",
1928
+ "accounts[].ataDevices[].temperatureSensorOutdoor"
1929
+ ]
1930
+ },
1915
1931
  {
1916
1932
  "key": "accounts[].ataDevices[].buttonsSensors",
1917
1933
  "type": "tabarray",
@@ -1971,26 +1987,6 @@
1971
1987
  "functionBody": "return model.accounts[arrayIndices[0]].atwDevices[arrayIndices[1]].displayType > 0;"
1972
1988
  }
1973
1989
  },
1974
- {
1975
- "title": "Temperature Sensors",
1976
- "type": "section",
1977
- "expandable": true,
1978
- "expanded": false,
1979
- "items": [
1980
- "accounts[].atwDevices[].temperatureSensor",
1981
- "accounts[].atwDevices[].temperatureSensorFlow",
1982
- "accounts[].atwDevices[].temperatureSensorReturn",
1983
- "accounts[].atwDevices[].temperatureSensorFlowZone1",
1984
- "accounts[].atwDevices[].temperatureSensorReturnZone1",
1985
- "accounts[].atwDevices[].temperatureSensorFlowWaterTank",
1986
- "accounts[].atwDevices[].temperatureSensorReturnWaterTank",
1987
- "accounts[].atwDevices[].temperatureSensorFlowZone2",
1988
- "accounts[].atwDevices[].temperatureSensorReturnZone2"
1989
- ],
1990
- "condition": {
1991
- "functionBody": "return model.accounts[arrayIndices[0]].atwDevices[arrayIndices[1]].displayType > 0;"
1992
- }
1993
- },
1994
1990
  {
1995
1991
  "title": "Presets",
1996
1992
  "type": "section",
@@ -2022,6 +2018,24 @@
2022
2018
  "expandable": true,
2023
2019
  "expanded": false,
2024
2020
  "items": [
2021
+ "accounts[].atwDevices[].errorSensor",
2022
+ {
2023
+ "title": "Temperature Sensors",
2024
+ "type": "section",
2025
+ "expandable": true,
2026
+ "expanded": false,
2027
+ "items": [
2028
+ "accounts[].atwDevices[].temperatureSensor",
2029
+ "accounts[].atwDevices[].temperatureSensorFlow",
2030
+ "accounts[].atwDevices[].temperatureSensorReturn",
2031
+ "accounts[].atwDevices[].temperatureSensorFlowZone1",
2032
+ "accounts[].atwDevices[].temperatureSensorReturnZone1",
2033
+ "accounts[].atwDevices[].temperatureSensorFlowWaterTank",
2034
+ "accounts[].atwDevices[].temperatureSensorReturnWaterTank",
2035
+ "accounts[].atwDevices[].temperatureSensorFlowZone2",
2036
+ "accounts[].atwDevices[].temperatureSensorReturnZone2"
2037
+ ]
2038
+ },
2025
2039
  {
2026
2040
  "key": "accounts[].atwDevices[].buttonsSensors",
2027
2041
  "type": "tabarray",
@@ -2080,20 +2094,6 @@
2080
2094
  "functionBody": "return model.accounts[arrayIndices[0]].ervDevices[arrayIndices[1]].displayType > 0;"
2081
2095
  }
2082
2096
  },
2083
- {
2084
- "title": "Temperature Sensors",
2085
- "type": "section",
2086
- "expandable": true,
2087
- "expanded": false,
2088
- "items": [
2089
- "accounts[].ervDevices[].temperatureSensor",
2090
- "accounts[].ervDevices[].temperatureSensorOutdoor",
2091
- "accounts[].ervDevices[].temperatureSensorSupply"
2092
- ],
2093
- "condition": {
2094
- "functionBody": "return model.accounts[arrayIndices[0]].ervDevices[arrayIndices[1]].displayType > 0;"
2095
- }
2096
- },
2097
2097
  {
2098
2098
  "title": "Presets",
2099
2099
  "type": "section",
@@ -2125,6 +2125,18 @@
2125
2125
  "expandable": true,
2126
2126
  "expanded": false,
2127
2127
  "items": [
2128
+ "accounts[].ervDevices[].errorSensor",
2129
+ {
2130
+ "title": "Temperature Sensors",
2131
+ "type": "section",
2132
+ "expandable": true,
2133
+ "expanded": false,
2134
+ "items": [
2135
+ "accounts[].ervDevices[].temperatureSensor",
2136
+ "accounts[].ervDevices[].temperatureSensorOutdoor",
2137
+ "accounts[].ervDevices[].temperatureSensorSupply"
2138
+ ]
2139
+ },
2128
2140
  {
2129
2141
  "key": "accounts[].ervDevices[].buttonsSensors",
2130
2142
  "type": "tabarray",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "displayName": "MELCloud Control",
3
3
  "name": "homebridge-melcloud-control",
4
- "version": "4.0.0-beta.556",
4
+ "version": "4.0.0-beta.559",
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
@@ -29,6 +29,7 @@ class DeviceAta extends EventEmitter {
29
29
  this.displayType = device.displayType;
30
30
  this.temperatureSensor = device.temperatureSensor || false;
31
31
  this.temperatureSensorOutdoor = device.temperatureSensorOutdoor || false;
32
+ this.errorSensor = device.errorSensor || false;
32
33
  this.heatDryFanMode = device.heatDryFanMode || 1; //NONE, HEAT, DRY, FAN
33
34
  this.coolDryFanMode = device.coolDryFanMode || 1; //NONE, COOL, DRY, FAN
34
35
  this.autoDryFanMode = device.autoDryFanMode || 1; //NONE, AUTO, DRY, FAN
@@ -605,16 +606,18 @@ class DeviceAta extends EventEmitter {
605
606
  };
606
607
 
607
608
  //error sensor
608
- if (this.logDebug) this.emit('debug', `Prepare error service`);
609
- this.errorService = new Service.ContactSensor(`${serviceName} Error`, `Error Sensor ${deviceId}`);
610
- this.errorService.addOptionalCharacteristic(Characteristic.ConfiguredName);
611
- this.errorService.setCharacteristic(Characteristic.ConfiguredName, `${accessoryName} Error`);
612
- this.errorService.getCharacteristic(Characteristic.ContactSensorState)
613
- .onGet(async () => {
614
- const state = this.accessory.isInError;
615
- return state;
616
- })
617
- accessory.addService(this.errorService);
609
+ if (this.errorSensor) {
610
+ if (this.logDebug) this.emit('debug', `Prepare error service`);
611
+ this.errorService = new Service.ContactSensor(`${serviceName} Error`, `Error Sensor ${deviceId}`);
612
+ this.errorService.addOptionalCharacteristic(Characteristic.ConfiguredName);
613
+ this.errorService.setCharacteristic(Characteristic.ConfiguredName, `${accessoryName} Error`);
614
+ this.errorService.getCharacteristic(Characteristic.ContactSensorState)
615
+ .onGet(async () => {
616
+ const state = this.accessory.isInError;
617
+ return state;
618
+ })
619
+ accessory.addService(this.errorService);
620
+ }
618
621
 
619
622
  //presets services
620
623
  if (this.presets.length > 0) {
package/src/deviceatw.js CHANGED
@@ -37,6 +37,7 @@ class DeviceAtw extends EventEmitter {
37
37
  this.temperatureSensorReturnWaterTank = device.temperatureSensorReturnWaterTank || false;
38
38
  this.temperatureSensorFlowZone2 = device.temperatureSensorFlowZone2 || false;
39
39
  this.temperatureSensorReturnZone2 = device.temperatureSensorReturnZone2 || false;
40
+ this.errorSensor = device.errorSensor || false;
40
41
  this.presets = (device.presets || []).filter(preset => (preset.displayType ?? 0) > 0);
41
42
  this.buttons = (device.buttonsSensors || []).filter(button => (button.displayType ?? 0) > 0);
42
43
  this.deviceId = device.id;
@@ -868,16 +869,18 @@ class DeviceAtw extends EventEmitter {
868
869
  };
869
870
 
870
871
  //error sensor
871
- if (this.logDebug) this.emit('debug', `Prepare error service`);
872
- this.errorService = new Service.ContactSensor(`${serviceName} Error`, `Error Sensor ${deviceId}`);
873
- this.errorService.addOptionalCharacteristic(Characteristic.ConfiguredName);
874
- this.errorService.setCharacteristic(Characteristic.ConfiguredName, `${accessoryName} Error`);
875
- this.errorService.getCharacteristic(Characteristic.ContactSensorState)
876
- .onGet(async () => {
877
- const state = this.accessory.isInError;
878
- return state;
879
- })
880
- accessory.addService(this.errorService);
872
+ if (this.errorSensor) {
873
+ if (this.logDebug) this.emit('debug', `Prepare error service`);
874
+ this.errorService = new Service.ContactSensor(`${serviceName} Error`, `Error Sensor ${deviceId}`);
875
+ this.errorService.addOptionalCharacteristic(Characteristic.ConfiguredName);
876
+ this.errorService.setCharacteristic(Characteristic.ConfiguredName, `${accessoryName} Error`);
877
+ this.errorService.getCharacteristic(Characteristic.ContactSensorState)
878
+ .onGet(async () => {
879
+ const state = this.accessory.isInError;
880
+ return state;
881
+ })
882
+ accessory.addService(this.errorService);
883
+ }
881
884
  break;
882
885
  case caseZone1Sensor: //Zone 1
883
886
  if (zone.roomTemperature !== null) {
package/src/deviceerv.js CHANGED
@@ -30,6 +30,7 @@ class DeviceErv extends EventEmitter {
30
30
  this.temperatureSensor = device.temperatureSensor || false;
31
31
  this.temperatureSensorOutdoor = device.temperatureSensorOutdoor || false;
32
32
  this.temperatureSensorSupply = device.temperatureSensorSupply || false;
33
+ this.errorSensor = device.errorSensor || false;
33
34
  this.presets = (device.presets || []).filter(preset => (preset.displayType ?? 0) > 0);
34
35
  this.buttons = (device.buttonsSensors || []).filter(button => (button.displayType ?? 0) > 0);
35
36
  this.deviceId = device.id;
@@ -655,16 +656,18 @@ class DeviceErv extends EventEmitter {
655
656
  }
656
657
 
657
658
  //error sensor
658
- if (this.logDebug) this.emit('debug', `Prepare error service`);
659
- this.errorService = new Service.ContactSensor(`${serviceName} Error`, `Error Sensor ${deviceId}`);
660
- this.errorService.addOptionalCharacteristic(Characteristic.ConfiguredName);
661
- this.errorService.setCharacteristic(Characteristic.ConfiguredName, `${accessoryName} Error`);
662
- this.errorService.getCharacteristic(Characteristic.ContactSensorState)
663
- .onGet(async () => {
664
- const state = this.accessory.isInError;
665
- return state;
666
- })
667
- accessory.addService(this.errorService);
659
+ if (this.errorSensor) {
660
+ if (this.logDebug) this.emit('debug', `Prepare error service`);
661
+ this.errorService = new Service.ContactSensor(`${serviceName} Error`, `Error Sensor ${deviceId}`);
662
+ this.errorService.addOptionalCharacteristic(Characteristic.ConfiguredName);
663
+ this.errorService.setCharacteristic(Characteristic.ConfiguredName, `${accessoryName} Error`);
664
+ this.errorService.getCharacteristic(Characteristic.ContactSensorState)
665
+ .onGet(async () => {
666
+ const state = this.accessory.isInError;
667
+ return state;
668
+ })
669
+ accessory.addService(this.errorService);
670
+ }
668
671
 
669
672
  //presets services
670
673
  if (this.presets.length > 0) {
package/src/melcloud.js CHANGED
@@ -498,6 +498,7 @@ class MelCloud extends EventEmitter {
498
498
  async send(accountInfo) {
499
499
  try {
500
500
  const axiosInstance = axios.create({
501
+ method: 'POST',
501
502
  baseURL: ApiUrls.BaseURL,
502
503
  timeout: 15000,
503
504
  headers: {
@@ -506,8 +507,8 @@ class MelCloud extends EventEmitter {
506
507
  }
507
508
  });
508
509
 
509
- const options = { data: accountInfo.LoginData };
510
- await axiosInstance.post(ApiUrls.UpdateApplicationOptions, options);
510
+ const payload = { data: accountInfo.LoginData };
511
+ await axiosInstance(ApiUrls.UpdateApplicationOptions, payload);
511
512
  await this.functions.saveData(this.accountFile, accountInfo);
512
513
  return true;
513
514
  } catch (error) {