homebridge-melcloud-control 4.4.0-beta.1 → 4.4.0-beta.3
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 +1 -1
- package/src/deviceata.js +18 -10
- package/src/melcloudata.js +4 -6
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"displayName": "MELCloud Control",
|
|
3
3
|
"name": "homebridge-melcloud-control",
|
|
4
|
-
"version": "4.4.0-beta.
|
|
4
|
+
"version": "4.4.0-beta.3",
|
|
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
|
@@ -758,8 +758,10 @@ class DeviceAta extends EventEmitter {
|
|
|
758
758
|
})
|
|
759
759
|
.onSet(async (value) => {
|
|
760
760
|
try {
|
|
761
|
-
deviceData.FrostProtection.
|
|
762
|
-
|
|
761
|
+
let { min, max } = await this.functions.normalizeFrostProtection(deviceData.FrostProtection.Min, value);
|
|
762
|
+
deviceData.FrostProtection.Min = min;
|
|
763
|
+
deviceData.FrostProtection.Max = max;
|
|
764
|
+
if (this.logInfo) this.emit('info', `Set frost protection max. temperature: ${max}${this.accessory.temperatureUnit}`);
|
|
763
765
|
await this.melCloudAta.send(this.accountType, this.displayType, deviceData, 'frostprotection');
|
|
764
766
|
} catch (error) {
|
|
765
767
|
if (this.logWarn) this.emit('warn', `Set frost protection max. temperature error: ${error}`);
|
|
@@ -777,8 +779,10 @@ class DeviceAta extends EventEmitter {
|
|
|
777
779
|
})
|
|
778
780
|
.onSet(async (value) => {
|
|
779
781
|
try {
|
|
780
|
-
deviceData.FrostProtection.
|
|
781
|
-
|
|
782
|
+
let { min, max } = await this.functions.normalizeFrostProtection(value, deviceData.FrostProtection.Max);
|
|
783
|
+
deviceData.FrostProtection.Min = min;
|
|
784
|
+
deviceData.FrostProtection.Max = max;
|
|
785
|
+
if (this.logInfo) this.emit('info', `Set frost protection min. temperature: ${min}${this.accessory.temperatureUnit}`);
|
|
782
786
|
await this.melCloudAta.send(this.accountType, this.displayType, deviceData, 'frostprotection');
|
|
783
787
|
} catch (error) {
|
|
784
788
|
if (this.logWarn) this.emit('warn', `Set frost protection min. temperature error: ${error}`);
|
|
@@ -873,8 +877,10 @@ class DeviceAta extends EventEmitter {
|
|
|
873
877
|
})
|
|
874
878
|
.onSet(async (value) => {
|
|
875
879
|
try {
|
|
876
|
-
deviceData.OverheatProtection.
|
|
877
|
-
|
|
880
|
+
let { min, max } = await this.functions.normalizeOverheatProtection(deviceData.OverheatProtection.Min, value);
|
|
881
|
+
deviceData.OverheatProtection.Min = min;
|
|
882
|
+
deviceData.OverheatProtection.Max = max;
|
|
883
|
+
if (this.logInfo) this.emit('info', `Set overheat protection max. temperature: ${max}${this.accessory.temperatureUnit}`);
|
|
878
884
|
await this.melCloudAta.send(this.accountType, this.displayType, deviceData, 'overheatprotection');
|
|
879
885
|
} catch (error) {
|
|
880
886
|
if (this.logWarn) this.emit('warn', `Set overheat protection max. temperature error: ${error}`);
|
|
@@ -892,8 +898,10 @@ class DeviceAta extends EventEmitter {
|
|
|
892
898
|
})
|
|
893
899
|
.onSet(async (value) => {
|
|
894
900
|
try {
|
|
895
|
-
deviceData.OverheatProtection.
|
|
896
|
-
|
|
901
|
+
let { min, max } = await this.functions.normalizeOverheatProtection(value, deviceData.OverheatProtection.Max);
|
|
902
|
+
deviceData.OverheatProtection.Min = min;
|
|
903
|
+
deviceData.OverheatProtection.Max = max;
|
|
904
|
+
if (this.logInfo) this.emit('info', `Set overheat protection min. temperature: ${min}${this.accessory.temperatureUnit}`);
|
|
897
905
|
await this.melCloudAta.send(this.accountType, this.displayType, deviceData, 'overheatprotection');
|
|
898
906
|
} catch (error) {
|
|
899
907
|
if (this.logWarn) this.emit('warn', `Set overheat protection min. temperature error: ${error}`);
|
|
@@ -1767,7 +1775,7 @@ class DeviceAta extends EventEmitter {
|
|
|
1767
1775
|
if (this.frostProtectionSupport && frostProtection.Enabled !== null) {
|
|
1768
1776
|
this.frostProtectionControlService?.updateCharacteristic(Characteristic.Active, frostProtection.Enabled);
|
|
1769
1777
|
this.frostProtectionControlService?.updateCharacteristic(Characteristic.CurrentHeaterCoolerState, frostProtection.Active ? 2 : 1);
|
|
1770
|
-
this.frostProtectionControlService?.updateCharacteristic(Characteristic.TargetHeaterCoolerState,
|
|
1778
|
+
this.frostProtectionControlService?.updateCharacteristic(Characteristic.TargetHeaterCoolerState, 0);
|
|
1771
1779
|
this.frostProtectionControlService?.updateCharacteristic(Characteristic.CurrentTemperature, roomTemperature);
|
|
1772
1780
|
this.frostProtectionControlService?.updateCharacteristic(Characteristic.CoolingThresholdTemperature, frostProtection.Max);
|
|
1773
1781
|
this.frostProtectionControlService?.updateCharacteristic(Characteristic.HeatingThresholdTemperature, frostProtection.Min);
|
|
@@ -1779,7 +1787,7 @@ class DeviceAta extends EventEmitter {
|
|
|
1779
1787
|
if (this.overheatProtectionSupport && overheatProtection.Enabled !== null) {
|
|
1780
1788
|
this.overheatProtectionControlService?.updateCharacteristic(Characteristic.Active, overheatProtection.Enabled);
|
|
1781
1789
|
this.overheatProtectionControlService?.updateCharacteristic(Characteristic.CurrentHeaterCoolerState, overheatProtection.Active ? 2 : 1);
|
|
1782
|
-
this.overheatProtectionControlService?.updateCharacteristic(Characteristic.TargetHeaterCoolerState,
|
|
1790
|
+
this.overheatProtectionControlService?.updateCharacteristic(Characteristic.TargetHeaterCoolerState, 0);
|
|
1783
1791
|
this.overheatProtectionControlService?.updateCharacteristic(Characteristic.CurrentTemperature, roomTemperature);
|
|
1784
1792
|
this.overheatProtectionControlService?.updateCharacteristic(Characteristic.CoolingThresholdTemperature, overheatProtection.Max);
|
|
1785
1793
|
this.overheatProtectionControlService?.updateCharacteristic(Characteristic.HeatingThresholdTemperature, overheatProtection.Min);
|
package/src/melcloudata.js
CHANGED
|
@@ -240,22 +240,20 @@ class MelCloudAta extends EventEmitter {
|
|
|
240
240
|
case "melcloudhome":
|
|
241
241
|
switch (flag) {
|
|
242
242
|
case 'frostprotection':
|
|
243
|
-
let { frostMin, frostMax } = await this.functions.normalizeFrostProtection(deviceData.FrostProtection.Min, deviceData.FrostProtection.Max);
|
|
244
243
|
payload = {
|
|
245
244
|
enabled: deviceData.FrostProtection.Enabled,
|
|
246
|
-
min:
|
|
247
|
-
max:
|
|
245
|
+
min: deviceData.FrostProtection.Min,
|
|
246
|
+
max: deviceData.FrostProtection.Max,
|
|
248
247
|
units: { ATA: [deviceData.DeviceID] }
|
|
249
248
|
};
|
|
250
249
|
method = 'POST';
|
|
251
250
|
path = ApiUrlsHome.PostProtectionFrost;
|
|
252
251
|
break;
|
|
253
252
|
case 'overheatprotection':
|
|
254
|
-
let { overMin, overMax } = await this.functions.normalizeOverheatProtection(deviceData.OverheatProtection.Min, deviceData.OverheatProtection.Max);
|
|
255
253
|
payload = {
|
|
256
254
|
enabled: deviceData.OverheatProtection.Enabled,
|
|
257
|
-
min:
|
|
258
|
-
max:
|
|
255
|
+
min: deviceData.OverheatProtection.Min,
|
|
256
|
+
max: deviceData.OverheatProtection.Max,
|
|
259
257
|
units: { ATA: [deviceData.DeviceID] }
|
|
260
258
|
};
|
|
261
259
|
method = 'POST';
|