homebridge-melcloud-control 3.8.4-beta.4 → 3.8.4-beta.6

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.
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.4-beta.4",
4
+ "version": "3.8.4-beta.6",
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
@@ -86,7 +86,7 @@ class DeviceAta extends EventEmitter {
86
86
 
87
87
  //accessory
88
88
  this.accessory = {};
89
- this.accessory.useFahrenheit = useFahrenheit ? 1 : 0;
89
+ this.useFahrenheit = useFahrenheit ? 1 : 0;
90
90
  };
91
91
 
92
92
  async externalIntegrations() {
@@ -1012,7 +1012,7 @@ class DeviceAta extends EventEmitter {
1012
1012
  const outdoorTemperature = deviceData.Device.OutdoorTemperature;
1013
1013
 
1014
1014
  //accessory
1015
- this.accessory = {
1015
+ const obj = {
1016
1016
  presets: presetsOnServer,
1017
1017
  hasAutomaticFanSpeed: hasAutomaticFanSpeed,
1018
1018
  airDirectionFunction: airDirectionFunction,
@@ -1045,7 +1045,8 @@ class DeviceAta extends EventEmitter {
1045
1045
  swingMode: swingFunction && vaneHorizontalDirection === 12 && vaneVerticalDirection === 7 ? 1 : 0,
1046
1046
  lockPhysicalControl: prohibitSetTemperature && prohibitOperationMode && prohibitPower ? 1 : 0,
1047
1047
  temperatureIncrement: temperatureIncrement,
1048
- temperatureUnit: TemperatureDisplayUnits[this.accessory.useFahrenheit]
1048
+ useFahrenheit: this.useFahrenheit,
1049
+ temperatureUnit: TemperatureDisplayUnits[this.useFahrenheit]
1049
1050
  };
1050
1051
 
1051
1052
  //operating mode 0, HEAT, DRY, COOL, 4, 5, 6, FAN, AUTO, ISEE HEAT, ISEE DRY, ISEE COOL
@@ -1053,69 +1054,69 @@ class DeviceAta extends EventEmitter {
1053
1054
  case 1: //Heater Cooler
1054
1055
  switch (operationMode) {
1055
1056
  case 1: //HEAT
1056
- this.accessory.currentOperationMode = roomTemperature > setTemperature ? 1 : 2; //INACTIVE, IDLE, HEATING, COOLING
1057
- this.accessory.targetOperationMode = 1; //AUTO, HEAT, COOL
1057
+ obj.currentOperationMode = roomTemperature > setTemperature ? 1 : 2; //INACTIVE, IDLE, HEATING, COOLING
1058
+ obj.targetOperationMode = 1; //AUTO, HEAT, COOL
1058
1059
  break;
1059
1060
  case 2: //DRY
1060
- this.accessory.currentOperationMode = 1;
1061
- this.accessory.targetOperationMode = this.autoDryFanMode === 2 ? 0 : this.heatDryFanMode === 2 ? 1 : this.coolDryFanMode === 2 ? 2 : this.accessory.targetOperationMode ?? 0;
1061
+ obj.currentOperationMode = 1;
1062
+ obj.targetOperationMode = this.autoDryFanMode === 2 ? 0 : this.heatDryFanMode === 2 ? 1 : this.coolDryFanMode === 2 ? 2 : obj.targetOperationMode ?? 0;
1062
1063
  break;
1063
1064
  case 3: //COOL
1064
- this.accessory.currentOperationMode = roomTemperature < setTemperature ? 1 : 3;
1065
- this.accessory.targetOperationMode = 2;
1065
+ obj.currentOperationMode = roomTemperature < setTemperature ? 1 : 3;
1066
+ obj.targetOperationMode = 2;
1066
1067
  break;
1067
1068
  case 7: //FAN
1068
- this.accessory.currentOperationMode = 1;
1069
- this.accessory.targetOperationMode = this.autoDryFanMode === 3 ? 0 : this.heatDryFanMode === 3 ? 1 : this.coolDryFanMode === 3 ? 2 : this.accessory.targetOperationMode ?? 0;
1069
+ obj.currentOperationMode = 1;
1070
+ obj.targetOperationMode = this.autoDryFanMode === 3 ? 0 : this.heatDryFanMode === 3 ? 1 : this.coolDryFanMode === 3 ? 2 : obj.targetOperationMode ?? 0;
1070
1071
  break;
1071
1072
  case 8: //AUTO
1072
- this.accessory.currentOperationMode = roomTemperature > setTemperature ? 3 : roomTemperature < setTemperature ? 2 : 1;
1073
- this.accessory.targetOperationMode = 0;
1073
+ obj.currentOperationMode = roomTemperature > setTemperature ? 3 : roomTemperature < setTemperature ? 2 : 1;
1074
+ obj.targetOperationMode = 0;
1074
1075
  break;
1075
1076
  case 9: //ISEE HEAT
1076
- this.accessory.currentOperationMode = roomTemperature > setTemperature ? 1 : 2
1077
- this.accessory.targetOperationMode = 1;
1077
+ obj.currentOperationMode = roomTemperature > setTemperature ? 1 : 2
1078
+ obj.targetOperationMode = 1;
1078
1079
  break;
1079
1080
  case 10: //ISEE DRY
1080
- this.accessory.currentOperationMode = 1;
1081
- this.accessory.targetOperationMode = this.autoDryFanMode === 2 ? 0 : this.heatDryFanMode === 2 ? 1 : this.coolDryFanMode === 2 ? 2 : this.accessory.targetOperationMode ?? 0;
1081
+ obj.currentOperationMode = 1;
1082
+ obj.targetOperationMode = this.autoDryFanMode === 2 ? 0 : this.heatDryFanMode === 2 ? 1 : this.coolDryFanMode === 2 ? 2 : obj.targetOperationMode ?? 0;
1082
1083
  break;
1083
1084
  case 11: //ISEE COOL;
1084
- this.accessory.currentOperationMode = roomTemperature < setTemperature ? 1 : 3;
1085
- this.accessory.targetOperationMode = 2;
1085
+ obj.currentOperationMode = roomTemperature < setTemperature ? 1 : 3;
1086
+ obj.targetOperationMode = 2;
1086
1087
  break;
1087
1088
  default:
1088
1089
  this.emit('warn', `Unknown operating mode: ${operationMode}`);
1089
1090
  return
1090
1091
  };
1091
1092
 
1092
- this.accessory.currentOperationMode = !power ? 0 : inStandbyMode ? 1 : this.accessory.currentOperationMode;
1093
- this.accessory.operationModeSetPropsMinValue = modelSupportsAuto && modelSupportsHeat ? 0 : !modelSupportsAuto && modelSupportsHeat ? 1 : modelSupportsAuto && !modelSupportsHeat ? 0 : 2;
1094
- this.accessory.operationModeSetPropsMaxValue = 2
1095
- this.accessory.operationModeSetPropsValidValues = modelSupportsAuto && modelSupportsHeat ? [0, 1, 2] : !modelSupportsAuto && modelSupportsHeat ? [1, 2] : modelSupportsAuto && !modelSupportsHeat ? [0, 2] : [2];
1093
+ obj.currentOperationMode = !power ? 0 : inStandbyMode ? 1 : obj.currentOperationMode;
1094
+ obj.operationModeSetPropsMinValue = modelSupportsAuto && modelSupportsHeat ? 0 : !modelSupportsAuto && modelSupportsHeat ? 1 : modelSupportsAuto && !modelSupportsHeat ? 0 : 2;
1095
+ obj.operationModeSetPropsMaxValue = 2
1096
+ obj.operationModeSetPropsValidValues = modelSupportsAuto && modelSupportsHeat ? [0, 1, 2] : !modelSupportsAuto && modelSupportsHeat ? [1, 2] : modelSupportsAuto && !modelSupportsHeat ? [0, 2] : [2];
1096
1097
 
1097
1098
  //fan speed mode
1098
1099
  if (modelSupportsFanSpeed) {
1099
1100
  switch (numberOfFanSpeeds) {
1100
1101
  case 2: //Fan speed mode 2
1101
- this.accessory.fanSpeed = hasAutomaticFanSpeed ? [3, 1, 2][fanSpeed] : [0, 1, 2][fanSpeed];
1102
- this.accessory.fanSpeedSetPropsMaxValue = hasAutomaticFanSpeed ? 3 : 2;
1102
+ obj.fanSpeed = hasAutomaticFanSpeed ? [3, 1, 2][fanSpeed] : [0, 1, 2][fanSpeed];
1103
+ obj.fanSpeedSetPropsMaxValue = hasAutomaticFanSpeed ? 3 : 2;
1103
1104
  break;
1104
1105
  case 3: //Fan speed mode 3
1105
- this.accessory.fanSpeed = hasAutomaticFanSpeed ? [4, 1, 2, 3][fanSpeed] : [0, 1, 2, 3][fanSpeed];
1106
- this.accessory.fanSpeedSetPropsMaxValue = hasAutomaticFanSpeed ? 4 : 3;
1106
+ obj.fanSpeed = hasAutomaticFanSpeed ? [4, 1, 2, 3][fanSpeed] : [0, 1, 2, 3][fanSpeed];
1107
+ obj.fanSpeedSetPropsMaxValue = hasAutomaticFanSpeed ? 4 : 3;
1107
1108
  break;
1108
1109
  case 4: //Fan speed mode 4
1109
- this.accessory.fanSpeed = hasAutomaticFanSpeed ? [5, 1, 2, 3, 4][fanSpeed] : [0, 1, 2, 3, 4][fanSpeed];
1110
- this.accessory.fanSpeedSetPropsMaxValue = hasAutomaticFanSpeed ? 5 : 4;
1110
+ obj.fanSpeed = hasAutomaticFanSpeed ? [5, 1, 2, 3, 4][fanSpeed] : [0, 1, 2, 3, 4][fanSpeed];
1111
+ obj.fanSpeedSetPropsMaxValue = hasAutomaticFanSpeed ? 5 : 4;
1111
1112
  break;
1112
1113
  case 5: //Fan speed mode 5
1113
- this.accessory.fanSpeed = hasAutomaticFanSpeed ? [6, 1, 2, 3, 4, 5][fanSpeed] : [0, 1, 2, 3, 4, 5][fanSpeed];
1114
- this.accessory.fanSpeedSetPropsMaxValue = hasAutomaticFanSpeed ? 6 : 5;
1114
+ obj.fanSpeed = hasAutomaticFanSpeed ? [6, 1, 2, 3, 4, 5][fanSpeed] : [0, 1, 2, 3, 4, 5][fanSpeed];
1115
+ obj.fanSpeedSetPropsMaxValue = hasAutomaticFanSpeed ? 6 : 5;
1115
1116
  break;
1116
1117
  case 6: //Fan speed mode 6
1117
- this.accessory.fanSpeed = hasAutomaticFanSpeed ? [7, 1, 2, 3, 4, 5, 6][fanSpeed] : [0, 1, 2, 3, 4, 5, 6][fanSpeed];
1118
- this.accessory.fanSpeedSetPropsMaxValue = hasAutomaticFanSpeed ? 7 : 6;
1118
+ obj.fanSpeed = hasAutomaticFanSpeed ? [7, 1, 2, 3, 4, 5, 6][fanSpeed] : [0, 1, 2, 3, 4, 5, 6][fanSpeed];
1119
+ obj.fanSpeedSetPropsMaxValue = hasAutomaticFanSpeed ? 7 : 6;
1119
1120
  break;
1120
1121
  };
1121
1122
  };
@@ -1124,74 +1125,76 @@ class DeviceAta extends EventEmitter {
1124
1125
  if (this.melCloudService) {
1125
1126
  this.melCloudService
1126
1127
  .updateCharacteristic(Characteristic.Active, power ? 1 : 0)
1127
- .updateCharacteristic(Characteristic.CurrentHeaterCoolerState, this.accessory.currentOperationMode)
1128
- .updateCharacteristic(Characteristic.TargetHeaterCoolerState, this.accessory.targetOperationMode)
1128
+ .updateCharacteristic(Characteristic.CurrentHeaterCoolerState, obj.currentOperationMode)
1129
+ .updateCharacteristic(Characteristic.TargetHeaterCoolerState, obj.targetOperationMode)
1129
1130
  .updateCharacteristic(Characteristic.CurrentTemperature, roomTemperature)
1130
- .updateCharacteristic(Characteristic.LockPhysicalControls, this.accessory.lockPhysicalControl)
1131
- .updateCharacteristic(Characteristic.TemperatureDisplayUnits, this.accessory.useFahrenheit)
1131
+ .updateCharacteristic(Characteristic.LockPhysicalControls, obj.lockPhysicalControl)
1132
+ .updateCharacteristic(Characteristic.TemperatureDisplayUnits, obj.useFahrenheit)
1132
1133
  .updateCharacteristic(Characteristic.CoolingThresholdTemperature, defaultCoolingSetTemperature);
1133
1134
  const updateDefHeat = modelSupportsHeat ? this.melCloudService.updateCharacteristic(Characteristic.HeatingThresholdTemperature, defaultHeatingSetTemperature) : false;
1134
- const updateRS = modelSupportsFanSpeed ? this.melCloudService.updateCharacteristic(Characteristic.RotationSpeed, this.accessory.fanSpeed) : false;
1135
- const updateSM = swingFunction ? this.melCloudService.updateCharacteristic(Characteristic.SwingMode, this.accessory.swingMode) : false;
1135
+ const updateRS = modelSupportsFanSpeed ? this.melCloudService.updateCharacteristic(Characteristic.RotationSpeed, obj.fanSpeed) : false;
1136
+ const updateSM = swingFunction ? this.melCloudService.updateCharacteristic(Characteristic.SwingMode, obj.swingMode) : false;
1136
1137
  };
1137
1138
  break;
1138
1139
  case 2: //Thermostat
1139
1140
  switch (operationMode) {
1140
1141
  case 1: //HEAT
1141
- this.accessory.currentOperationMode = roomTemperature > setTemperature ? 0 : 1; //OFF, HEATING, COOLING
1142
- this.accessory.targetOperationMode = 1; //OFF, HEAT, COOL, AUTO
1142
+ obj.currentOperationMode = roomTemperature > setTemperature ? 0 : 1; //OFF, HEATING, COOLING
1143
+ obj.targetOperationMode = 1; //OFF, HEAT, COOL, AUTO
1143
1144
  break;
1144
1145
  case 2: //DRY
1145
- this.accessory.currentOperationMode = 0;
1146
- this.accessory.targetOperationMode = this.autoDryFanMode === 2 ? 3 : this.heatDryFanMode === 2 ? 1 : this.coolDryFanMode === 2 ? 2 : this.accessory.targetOperationMode ?? 0;
1146
+ obj.currentOperationMode = 0;
1147
+ obj.targetOperationMode = this.autoDryFanMode === 2 ? 3 : this.heatDryFanMode === 2 ? 1 : this.coolDryFanMode === 2 ? 2 : obj.targetOperationMode ?? 0;
1147
1148
  break;
1148
1149
  case 3: //COOL
1149
- this.accessory.currentOperationMode = roomTemperature < setTemperature ? 0 : 2;
1150
- this.accessory.targetOperationMode = 2;
1150
+ obj.currentOperationMode = roomTemperature < setTemperature ? 0 : 2;
1151
+ obj.targetOperationMode = 2;
1151
1152
  break;
1152
1153
  case 7: //FAN
1153
- this.accessory.currentOperationMode = 0;
1154
- this.accessory.targetOperationMode = this.autoDryFanMode === 3 ? 3 : this.heatDryFanMode === 3 ? 1 : this.coolDryFanMode === 3 ? 2 : this.accessory.targetOperationMode ?? 0;
1154
+ obj.currentOperationMode = 0;
1155
+ obj.targetOperationMode = this.autoDryFanMode === 3 ? 3 : this.heatDryFanMode === 3 ? 1 : this.coolDryFanMode === 3 ? 2 : obj.targetOperationMode ?? 0;
1155
1156
  break;
1156
1157
  case 8: //AUTO
1157
- this.accessory.currentOperationMode = roomTemperature < setTemperature ? 1 : roomTemperature > setTemperature ? 2 : 0;
1158
- this.accessory.targetOperationMode = 3;
1158
+ obj.currentOperationMode = roomTemperature < setTemperature ? 1 : roomTemperature > setTemperature ? 2 : 0;
1159
+ obj.targetOperationMode = 3;
1159
1160
  break;
1160
1161
  case 9: //ISEE HEAT
1161
- this.accessory.currentOperationMode = roomTemperature > setTemperature ? 0 : 1;
1162
- this.accessory.targetOperationMode = 1;
1162
+ obj.currentOperationMode = roomTemperature > setTemperature ? 0 : 1;
1163
+ obj.targetOperationMode = 1;
1163
1164
  break;
1164
1165
  case 10: //ISEE DRY
1165
- this.accessory.currentOperationMode = 0;
1166
- this.accessory.targetOperationMode = this.autoDryFanMode === 2 ? 3 : this.heatDryFanMode === 2 ? 1 : this.coolDryFanMode === 2 ? 2 : this.accessory.targetOperationMode ?? 0;
1166
+ obj.currentOperationMode = 0;
1167
+ obj.targetOperationMode = this.autoDryFanMode === 2 ? 3 : this.heatDryFanMode === 2 ? 1 : this.coolDryFanMode === 2 ? 2 : obj.targetOperationMode ?? 0;
1167
1168
  break;
1168
1169
  case 11: //ISEE COOL;
1169
- this.accessory.currentOperationMode = roomTemperature < setTemperature ? 0 : 2;
1170
- this.accessory.targetOperationMode = 2;
1170
+ obj.currentOperationMode = roomTemperature < setTemperature ? 0 : 2;
1171
+ obj.targetOperationMode = 2;
1171
1172
  break;
1172
1173
  default:
1173
1174
  this.emit('warn', `Unknown operating mode: ${operationMode}`);
1174
1175
  break;
1175
1176
  };
1176
1177
 
1177
- this.accessory.currentOperationMode = !power ? 0 : this.accessory.currentOperationMode;
1178
- this.accessory.targetOperationMode = !power ? 0 : this.accessory.targetOperationMode;
1179
- this.accessory.operationModeSetPropsMinValue = 0
1180
- this.accessory.operationModeSetPropsMaxValue = modelSupportsAuto && modelSupportsHeat ? 3 : !modelSupportsAuto && modelSupportsHeat ? 2 : modelSupportsAuto && !modelSupportsHeat ? 3 : 2;
1181
- this.accessory.operationModeSetPropsValidValues = modelSupportsAuto && modelSupportsHeat ? [0, 1, 2, 3] : !modelSupportsAuto && modelSupportsHeat ? [0, 1, 2] : modelSupportsAuto && !modelSupportsHeat ? [0, 2, 3] : [0, 2];
1178
+ obj.currentOperationMode = !power ? 0 : obj.currentOperationMode;
1179
+ obj.targetOperationMode = !power ? 0 : obj.targetOperationMode;
1180
+ obj.operationModeSetPropsMinValue = 0
1181
+ obj.operationModeSetPropsMaxValue = modelSupportsAuto && modelSupportsHeat ? 3 : !modelSupportsAuto && modelSupportsHeat ? 2 : modelSupportsAuto && !modelSupportsHeat ? 3 : 2;
1182
+ obj.operationModeSetPropsValidValues = modelSupportsAuto && modelSupportsHeat ? [0, 1, 2, 3] : !modelSupportsAuto && modelSupportsHeat ? [0, 1, 2] : modelSupportsAuto && !modelSupportsHeat ? [0, 2, 3] : [0, 2];
1182
1183
 
1183
1184
  //update characteristics
1184
1185
  if (this.melCloudService) {
1185
1186
  this.melCloudService
1186
- .updateCharacteristic(Characteristic.CurrentHeatingCoolingState, this.accessory.currentOperationMode)
1187
- .updateCharacteristic(Characteristic.TargetHeatingCoolingState, this.accessory.targetOperationMode)
1187
+ .updateCharacteristic(Characteristic.CurrentHeatingCoolingState, obj.currentOperationMode)
1188
+ .updateCharacteristic(Characteristic.TargetHeatingCoolingState, obj.targetOperationMode)
1188
1189
  .updateCharacteristic(Characteristic.CurrentTemperature, roomTemperature)
1189
1190
  .updateCharacteristic(Characteristic.TargetTemperature, setTemperature)
1190
- .updateCharacteristic(Characteristic.TemperatureDisplayUnits, this.accessory.useFahrenheit);
1191
+ .updateCharacteristic(Characteristic.TemperatureDisplayUnits, obj.useFahrenheit);
1191
1192
  };
1192
1193
  break;
1193
1194
  };
1194
1195
 
1196
+ this.accessory = obj;
1197
+
1195
1198
  if (this.roomTemperatureSensorService) {
1196
1199
  this.roomTemperatureSensorService
1197
1200
  .updateCharacteristic(Characteristic.CurrentTemperature, roomTemperature)
@@ -1321,7 +1324,7 @@ class DeviceAta extends EventEmitter {
1321
1324
  button.state = power ? (fanSpeed === 6) : false;
1322
1325
  break;
1323
1326
  case 37: //PHYSICAL LOCK CONTROLS ALL
1324
- button.state = (this.accessory.lockPhysicalControl === 1);
1327
+ button.state = (obj.lockPhysicalControl === 1);
1325
1328
  break;
1326
1329
  case 38: //PHYSICAL LOCK CONTROLS POWER
1327
1330
  button.state = (prohibitPower === true);
@@ -1350,17 +1353,17 @@ class DeviceAta extends EventEmitter {
1350
1353
  if (!this.disableLogInfo) {
1351
1354
  this.emit('info', `Power: ${power ? 'ON' : 'OFF'}`);
1352
1355
  this.emit('info', `Target operation mode: ${AirConditioner.DriveMode[operationMode]}`);
1353
- this.emit('info', `Current operation mode: ${this.displayMode === 1 ? AirConditioner.CurrentOperationModeHeatherCooler[this.accessory.currentOperationMode] : AirConditioner.CurrentOperationModeThermostat[this.accessory.currentOperationMode]}`);
1354
- this.emit('info', `Target temperature: ${setTemperature}${this.accessory.temperatureUnit}`);
1355
- this.emit('info', `Current temperature: ${roomTemperature}${this.accessory.temperatureUnit}`);
1356
- const info = hasOutdoorTemperature && outdoorTemperature !== null ? this.emit('info', `Outdoor temperature: ${outdoorTemperature}${this.accessory.temperatureUnit}`) : false;
1356
+ this.emit('info', `Current operation mode: ${this.displayMode === 1 ? AirConditioner.CurrentOperationModeHeatherCooler[obj.currentOperationMode] : AirConditioner.CurrentOperationModeThermostat[obj.currentOperationMode]}`);
1357
+ this.emit('info', `Target temperature: ${setTemperature}${obj.temperatureUnit}`);
1358
+ this.emit('info', `Current temperature: ${roomTemperature}${obj.temperatureUnit}`);
1359
+ const info = hasOutdoorTemperature && outdoorTemperature !== null ? this.emit('info', `Outdoor temperature: ${outdoorTemperature}${obj.temperatureUnit}`) : false;
1357
1360
  const info3 = modelSupportsFanSpeed ? this.emit('info', `Target fan speed: ${AirConditioner.FanSpeed[fanSpeed]}`) : false;
1358
1361
  const info4 = modelSupportsFanSpeed ? this.emit('info', `Current fan speed: ${AirConditioner.FanSpeed[actualFanSpeed]}`) : false;
1359
1362
  const info5 = vaneHorizontalDirection !== null ? this.emit('info', `Vane horizontal: ${AirConditioner.HorizontalVane[vaneHorizontalDirection] ?? vaneHorizontalDirection}`) : false;
1360
1363
  const info6 = vaneVerticalDirection !== null ? this.emit('info', `Vane vertical: ${AirConditioner.VerticalVane[vaneVerticalDirection] ?? vaneVerticalDirection}`) : false;
1361
- const info7 = swingFunction ? this.emit('info', `Air direction: ${AirConditioner.AirDirection[this.accessory.swingMode]}`) : false;
1362
- this.emit('info', `Temperature display unit: ${this.accessory.temperatureUnit}`);
1363
- this.emit('info', `Lock physical controls: ${this.accessory.lockPhysicalControl ? 'LOCKED' : 'UNLOCKED'}`);
1364
+ const info7 = swingFunction ? this.emit('info', `Air direction: ${AirConditioner.AirDirection[obj.swingMode]}`) : false;
1365
+ this.emit('info', `Temperature display unit: ${obj.temperatureUnit}`);
1366
+ this.emit('info', `Lock physical controls: ${obj.lockPhysicalControl ? 'LOCKED' : 'UNLOCKED'}`);
1364
1367
  };
1365
1368
 
1366
1369
  //prepare accessory
package/src/deviceatw.js CHANGED
@@ -95,7 +95,7 @@ class DeviceAtw extends EventEmitter {
95
95
  zones: [{}, {}, {}, {}],
96
96
  zonesSensors: [{}, {}, {}, {}]
97
97
  };
98
- this.accessory.useFahrenheit = useFahrenheit ? 1 : 0;
98
+ this.useFahrenheit = useFahrenheit ? 1 : 0;
99
99
  };
100
100
 
101
101
  async externalIntegrations() {
@@ -1438,7 +1438,8 @@ class DeviceAtw extends EventEmitter {
1438
1438
  this.accessory.caseHotWaterSensor = caseHotWaterSensor;
1439
1439
  this.accessory.caseZone2Sensor = caseZone2Sensor;
1440
1440
  this.accessory.sensorsCount = zonesSensorsCount;
1441
- this.accessory.temperatureUnit = TemperatureDisplayUnits[this.accessory.useFahrenheit];
1441
+ this.accessory.useFahrenheit = this.useFahrenheit;
1442
+ this.accessory.temperatureUnit = TemperatureDisplayUnits[this.useFahrenheit];
1442
1443
 
1443
1444
  //default values
1444
1445
  let name = 'Heat Pump'
package/src/deviceerv.js CHANGED
@@ -85,7 +85,7 @@ class DeviceErv extends EventEmitter {
85
85
 
86
86
  //accessory
87
87
  this.accessory = {};
88
- this.accessory.useFahrenheit = useFahrenheit ? 1 : 0;
88
+ this.useFahrenheit = useFahrenheit ? 1 : 0;
89
89
  };
90
90
 
91
91
  async externalIntegrations() {
@@ -971,7 +971,8 @@ class DeviceErv extends EventEmitter {
971
971
  this.accessory.temperatureIncrement = maxTempHeat;
972
972
  this.accessory.minTempCoolDry = minTempCoolDry;
973
973
  this.accessory.maxTempCoolDry = maxTempCoolDry;
974
- this.accessory.temperatureUnit = TemperatureDisplayUnits[this.accessory.useFahrenheit];
974
+ this.accessory.useFahrenheit = this.useFahrenheit;
975
+ this.accessory.temperatureUnit = TemperatureDisplayUnits[this.useFahrenheit];
975
976
 
976
977
  //ventilation mode - 0, HEAT, 2, COOL, 4, 5, 6, FAN, AUTO
977
978
  switch (this.displayMode) {