homebridge-melcloud-control 3.3.12-beta.16 → 3.3.12-beta.17

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/deviceata.js +22 -24
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.16",
4
+ "version": "3.3.12-beta.17",
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
@@ -375,7 +375,7 @@ class DeviceAta extends EventEmitter {
375
375
  .updateCharacteristic(Characteristic.CurrentTemperature, roomTemperature)
376
376
  .updateCharacteristic(Characteristic.LockPhysicalControls, this.accessory.lockPhysicalControl)
377
377
  .updateCharacteristic(Characteristic.TemperatureDisplayUnits, this.accessory.useFahrenheit);
378
- const updateDefHeat = modelSupportsHeat ? this.melCloudService.updateCharacteristic(Characteristic.HeatingThresholdTemperature, operationMode === 1 ? setTemperature : 10) : false;
378
+ const updateDefHeat = modelSupportsHeat ? this.melCloudService.updateCharacteristic(Characteristic.HeatingThresholdTemperature, setTemperature) : false;
379
379
  const updateDefCool = modelSupportsCool ? this.melCloudService.updateCharacteristic(Characteristic.CoolingThresholdTemperature, setTemperature) : false;
380
380
  const updateRS = modelSupportsFanSpeed ? this.melCloudService.updateCharacteristic(Characteristic.RotationSpeed, this.accessory.fanSpeed) : false;
381
381
  const updateSM = swingFunction ? this.melCloudService.updateCharacteristic(Characteristic.SwingMode, this.accessory.swingMode) : false;
@@ -911,28 +911,26 @@ class DeviceAta extends EventEmitter {
911
911
  };
912
912
  });
913
913
  };
914
- if (modelSupportsCool) {
915
- this.melCloudService.getCharacteristic(Characteristic.CoolingThresholdTemperature)
916
- .setProps({
917
- minValue: 16,
918
- maxValue: 31,
919
- minStep: this.accessory.temperatureIncrement
920
- })
921
- .onGet(async () => {
922
- const value = this.accessory.setTemperature;
923
- return value;
924
- })
925
- .onSet(async (value) => {
926
- try {
927
- deviceData.Device.SetTemperature = value;
928
- deviceData.Device.EffectiveFlags = CONSTANTS.AirConditioner.EffectiveFlags.SetTemperature;
929
- await this.melCloudAta.send(deviceData);
930
- const info = this.disableLogInfo ? false : this.emit('message', `Set cooling threshold temperature: ${value}${this.accessory.temperatureUnit}`);
931
- } catch (error) {
932
- this.emit('warn', `Set cooling threshold temperature error: ${error}`);
933
- };
934
- });
935
- };
914
+ this.melCloudService.getCharacteristic(Characteristic.CoolingThresholdTemperature)
915
+ .setProps({
916
+ minValue: 16,
917
+ maxValue: 31,
918
+ minStep: this.accessory.temperatureIncrement
919
+ })
920
+ .onGet(async () => {
921
+ const value = this.accessory.setTemperature;
922
+ return value;
923
+ })
924
+ .onSet(async (value) => {
925
+ try {
926
+ deviceData.Device.SetTemperature = value;
927
+ deviceData.Device.EffectiveFlags = CONSTANTS.AirConditioner.EffectiveFlags.SetTemperature;
928
+ await this.melCloudAta.send(deviceData);
929
+ const info = this.disableLogInfo ? false : this.emit('message', `Set temperature: ${value}${this.accessory.temperatureUnit}`);
930
+ } catch (error) {
931
+ this.emit('warn', `Set cooling threshold temperature error: ${error}`);
932
+ };
933
+ });
936
934
  if (modelSupportsHeat) {
937
935
  this.melCloudService.getCharacteristic(Characteristic.HeatingThresholdTemperature)
938
936
  .setProps({
@@ -949,7 +947,7 @@ class DeviceAta extends EventEmitter {
949
947
  if (this.accessory.operationMode === 1) {
950
948
  deviceData.Device.EffectiveFlags = CONSTANTS.AirConditioner.EffectiveFlags.SetTemperature;
951
949
  await this.melCloudAta.send(deviceData);
952
- const info = this.disableLogInfo ? false : this.emit('message', `Set heating threshold temperature: ${value}${this.accessory.temperatureUnit}`);
950
+ const info = this.disableLogInfo ? false : this.emit('message', `Set heat temperature: ${value}${this.accessory.temperatureUnit}`);
953
951
  };
954
952
 
955
953
  } catch (error) {