homebridge-melcloud-control 3.3.12-beta.11 → 3.3.12-beta.13

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.3.12-beta.11",
4
+ "version": "3.3.12-beta.13",
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
@@ -252,7 +252,6 @@ class DeviceAta extends EventEmitter {
252
252
  const temperatureIncrement = deviceData.Device.TemperatureIncrement ?? 1;
253
253
  const outdoorTemperature = deviceData.Device.OutdoorTemperature;
254
254
 
255
- this.emit('message', `Target temp: ${setTemperature}`);
256
255
  //accessory
257
256
  this.accessory.presets = presetsOnServer;
258
257
  this.accessory.hasAutomaticFanSpeed = hasAutomaticFanSpeed;
@@ -307,19 +306,7 @@ class DeviceAta extends EventEmitter {
307
306
  this.accessory.targetOperationMode = this.autoDryFanMode === 3 ? 0 : this.heatDryFanMode === 3 ? 1 : this.coolDryFanMode === 3 ? 2 : this.accessory.targetOperationMode;
308
307
  break;
309
308
  case 8: //AUTO
310
- switch (this.accessory.currentOperationMode) {
311
- case 2: //HEATING
312
- const heatingToFan = roomTemperature > (defaultHeatingSetTemperature + 1);
313
- this.accessory.currentOperationMode = heatingToFan ? 1 : 2;
314
- break;
315
- case 3: //COOLING
316
- const coolingToFan = roomTemperature < (defaultCoolingSetTemperature - 1);
317
- this.accessory.currentOperationMode = coolingToFan ? 1 : 3;
318
- break;
319
- default: //FAN
320
- this.accessory.currentOperationMode = roomTemperature >= defaultHeatingSetTemperature && roomTemperature <= defaultCoolingSetTemperature ? 1 : roomTemperature < defaultHeatingSetTemperature ? 2 : roomTemperature > defaultCoolingSetTemperature ? 3 : this.accessory.currentOperationMode;
321
- break;
322
- };
309
+ this.accessory.currentOperationMode = roomTemperature >= defaultHeatingSetTemperature && roomTemperature <= defaultCoolingSetTemperature ? 1 : roomTemperature < defaultHeatingSetTemperature ? 2 : roomTemperature > defaultCoolingSetTemperature ? 3 : this.accessory.currentOperationMode;
323
310
  this.accessory.targetOperationMode = 0;
324
311
  break;
325
312
  case 9: //ISEE HEAT
@@ -934,19 +921,12 @@ class DeviceAta extends EventEmitter {
934
921
  minStep: this.accessory.temperatureIncrement
935
922
  })
936
923
  .onGet(async () => {
937
- const value = this.accessory.operationMode === 8 ? this.accessory.defaultCoolingSetTemperature : this.accessory.setTemperature;
924
+ const value = this.accessory.setTemperature;
938
925
  return value;
939
926
  })
940
927
  .onSet(async (value) => {
941
928
  try {
942
- switch (this.accessory.operationMode) {
943
- case 8: //AUTO - AUTO
944
- deviceData.Device.DefaultCoolingSetTemperature = value;
945
- break;
946
- default:
947
- deviceData.Device.SetTemperature = value;
948
- break
949
- };
929
+ deviceData.Device.SetTemperature = value;
950
930
  deviceData.Device.EffectiveFlags = CONSTANTS.AirConditioner.EffectiveFlags.SetTemperature;
951
931
  await this.melCloudAta.send(deviceData);
952
932
  const info = this.disableLogInfo ? false : this.emit('message', `Set cooling threshold temperature: ${value}${this.accessory.temperatureUnit}`);
@@ -963,23 +943,17 @@ class DeviceAta extends EventEmitter {
963
943
  minStep: this.accessory.temperatureIncrement
964
944
  })
965
945
  .onGet(async () => {
966
- const value = this.accessory.operationMode === 8 ? this.accessory.defaultHeatingSetTemperature : this.accessory.setTemperature;
946
+ const value = this.accessory.operationMode === 1 ? this.accessory.setTemperature : 0;
967
947
  return value;
968
948
  })
969
949
  .onSet(async (value) => {
970
950
  try {
971
- switch (this.accessory.operationMode) {
972
- case 8: //AUTO - AUTO
973
- deviceData.Device.DefaultHeatingSetTemperature = value;
974
- break;
975
- default:
976
- deviceData.Device.SetTemperature = value;
977
- break
951
+ if (this.accessory.operationMode === 1) {
952
+ deviceData.Device.EffectiveFlags = CONSTANTS.AirConditioner.EffectiveFlags.SetTemperature;
953
+ await this.melCloudAta.send(deviceData);
954
+ const info = this.disableLogInfo ? false : this.emit('message', `Set heating threshold temperature: ${value}${this.accessory.temperatureUnit}`);
978
955
  };
979
956
 
980
- deviceData.Device.EffectiveFlags = CONSTANTS.AirConditioner.EffectiveFlags.SetTemperature;
981
- await this.melCloudAta.send(deviceData);
982
- const info = this.disableLogInfo ? false : this.emit('message', `Set heating threshold temperature: ${value}${this.accessory.temperatureUnit}`);
983
957
  } catch (error) {
984
958
  this.emit('warn', `Set heating threshold temperature error: ${error}`);
985
959
  };
@@ -414,8 +414,8 @@ class MelCloudAta extends EventEmitter {
414
414
  OperationMode: deviceData.Device.OperationMode,
415
415
  VaneHorizontal: deviceData.Device.VaneHorizontalDirection,
416
416
  VaneVertical: deviceData.Device.VaneVerticalDirection,
417
- DefaultHeatingSetTemperature: deviceData.Device.DefaultHeatingSetTemperature,
418
- DefaultCoolingSetTemperature: deviceData.Device.DefaultCoolingSetTemperature,
417
+ DefaultHeatingSetTemperature: deviceData.Device.DefaultHeatingSetTemperature ?? 21,
418
+ DefaultCoolingSetTemperature: deviceData.Device.DefaultCoolingSetTemperature ?? 23,
419
419
  InStandbyMode: deviceData.Device.InStandbyMode,
420
420
  ProhibitSetTemperature: deviceData.Device.ProhibitSetTemperature,
421
421
  ProhibitOperationMode: deviceData.Device.ProhibitOperationMode,