homebridge-melcloud-control 3.3.12-beta.4 → 3.3.12-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.3.12-beta.4",
4
+ "version": "3.3.12-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",
@@ -73,12 +73,6 @@
73
73
  ],
74
74
  "AirDirection": [
75
75
  "AUTO",
76
- "1",
77
- "2",
78
- "3",
79
- "4",
80
- "5",
81
- "6",
82
76
  "SWING"
83
77
  ],
84
78
  "FanSpeed": [
package/src/deviceata.js CHANGED
@@ -307,18 +307,17 @@ class DeviceAta extends EventEmitter {
307
307
  this.accessory.targetOperationMode = this.autoDryFanMode === 3 ? 0 : this.heatDryFanMode === 3 ? 1 : this.coolDryFanMode === 3 ? 2 : this.accessory.targetOperationMode;
308
308
  break;
309
309
  case 8: //AUTO
310
- const curentModeInAuto = roomTemperature < defaultHeatingSetTemperature ? 'HEATING' : roomTemperature > defaultCoolingSetTemperature ? 'COOLING' : '';
311
- switch (curentModeInAuto) {
312
- case 'HEATING': //HEATING
313
- const heatingToFan = roomTemperature > defaultHeatingSetTemperature + 1;
310
+ switch (this.accessory.currentOperationMode) {
311
+ case 2: //HEATING
312
+ const heatingToFan = roomTemperature >= (defaultHeatingSetTemperature + 1);
314
313
  this.accessory.currentOperationMode = heatingToFan ? 1 : 2;
315
314
  break;
316
- case 'COOLING': //COOLING
317
- const coolingToFan = roomTemperature < defaultCoolingSetTemperature - 1;
315
+ case 3: //COOLING
316
+ const coolingToFan = roomTemperature <= (defaultCoolingSetTemperature - 1);
318
317
  this.accessory.currentOperationMode = coolingToFan ? 1 : 3;
319
318
  break;
320
319
  default: //FAN
321
- this.accessory.currentOperationMode = roomTemperature <= defaultHeatingSetTemperature ? 2 : roomTemperature >= defaultCoolingSetTemperature ? 3 : 1;
320
+ this.accessory.currentOperationMode = roomTemperature > defaultCoolingSetTemperature ? 3 : roomTemperature < defaultHeatingSetTemperature ? 2 : 1;
322
321
  break;
323
322
  };
324
323
  this.accessory.targetOperationMode = 0;
@@ -648,7 +647,7 @@ class DeviceAta extends EventEmitter {
648
647
  const info4 = modelSupportsFanSpeed ? this.emit('message', `Current fan speed: ${CONSTANTS.AirConditioner.FanSpeed[actualFanSpeed]}`) : false;
649
648
  const info5 = vaneHorizontalDirection !== null ? this.emit('message', `Vane horizontal: ${CONSTANTS.AirConditioner.HorizontalVane[vaneHorizontalDirection]}`) : false;
650
649
  const info6 = vaneVerticalDirection !== null ? this.emit('message', `Vane vertical: ${CONSTANTS.AirConditioner.VerticalVane[vaneVerticalDirection]}`) : false;
651
- const info7 = swingFunction ? this.emit('message', `Air direction: ${CONSTANTS.AirConditioner.AirDirection[this.accessory.swingMode ? 7 : 0]}`) : false;
650
+ const info7 = swingFunction ? this.emit('message', `Air direction: ${CONSTANTS.AirConditioner.AirDirection[this.accessory.swingMode]}`) : false;
652
651
  this.emit('message', `Temperature display unit: ${this.accessory.temperatureUnit}`);
653
652
  this.emit('message', `Lock physical controls: ${this.accessory.lockPhysicalControl ? 'LOCKED' : 'UNLOCKED'}`);
654
653
  };
@@ -922,7 +921,7 @@ class DeviceAta extends EventEmitter {
922
921
  deviceData.Device.VaneVertical = value ? 7 : 0;
923
922
  deviceData.Device.EffectiveFlags = CONSTANTS.AirConditioner.EffectiveFlags.VaneHorizontal + CONSTANTS.AirConditioner.EffectiveFlags.VaneVertical;
924
923
  await this.melCloudAta.send(deviceData);
925
- const info = this.disableLogInfo ? false : this.emit('message', `Set air direction mode: ${CONSTANTS.AirConditioner.AirDirection[value ? 7 : 0]}`);
924
+ const info = this.disableLogInfo ? false : this.emit('message', `Set air direction mode: ${CONSTANTS.AirConditioner.AirDirection[value]}`);
926
925
  } catch (error) {
927
926
  this.emit('warn', `Set vane swing mode error: ${error}`);
928
927
  };