homebridge-melcloud-control 4.4.0-beta.22 → 4.4.0-beta.24
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/deviceatw.js +2 -2
- package/src/melcloudata.js +10 -0
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.24",
|
|
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/deviceatw.js
CHANGED
|
@@ -1115,7 +1115,7 @@ class DeviceAtw extends EventEmitter {
|
|
|
1115
1115
|
})
|
|
1116
1116
|
.onSet(async (value) => {
|
|
1117
1117
|
try {
|
|
1118
|
-
let { min, max } = await this.functions.adjustTempProtection(deviceData.FrostProtection.Min, deviceData.FrostProtection.Max, value, 4, 14, 6, 16);
|
|
1118
|
+
let { min, max } = await this.functions.adjustTempProtection(deviceData.FrostProtection.Min, deviceData.FrostProtection.Max, value, 'max', 4, 14, 6, 16);
|
|
1119
1119
|
deviceData.FrostProtection.Min = min;
|
|
1120
1120
|
deviceData.FrostProtection.Max = max;
|
|
1121
1121
|
if (this.logInfo) this.emit('info', `Set frost protection max. temperature: ${max}${this.accessory.temperatureUnit}`);
|
|
@@ -1136,7 +1136,7 @@ class DeviceAtw extends EventEmitter {
|
|
|
1136
1136
|
})
|
|
1137
1137
|
.onSet(async (value) => {
|
|
1138
1138
|
try {
|
|
1139
|
-
let { min, max } = await this.functions.adjustTempProtection(deviceData.FrostProtection.Min, deviceData.FrostProtection.Max, value, 4, 14, 6, 16);
|
|
1139
|
+
let { min, max } = await this.functions.adjustTempProtection(deviceData.FrostProtection.Min, deviceData.FrostProtection.Max, value, 'min', 4, 14, 6, 16);
|
|
1140
1140
|
deviceData.FrostProtection.Min = min;
|
|
1141
1141
|
deviceData.FrostProtection.Max = max;
|
|
1142
1142
|
if (this.logInfo) this.emit('info', `Set frost protection min. temperature: ${min}${this.accessory.temperatureUnit}`);
|
package/src/melcloudata.js
CHANGED
|
@@ -197,6 +197,7 @@ class MelCloudAta extends EventEmitter {
|
|
|
197
197
|
let method = null
|
|
198
198
|
let payload = {};
|
|
199
199
|
let path = '';
|
|
200
|
+
let update = false;
|
|
200
201
|
switch (accountType) {
|
|
201
202
|
case "melcloud":
|
|
202
203
|
switch (flag) {
|
|
@@ -249,6 +250,7 @@ class MelCloudAta extends EventEmitter {
|
|
|
249
250
|
};
|
|
250
251
|
method = 'POST';
|
|
251
252
|
path = ApiUrlsHome.PostProtectionFrost;
|
|
253
|
+
update = true;
|
|
252
254
|
break;
|
|
253
255
|
case 'overheatprotection':
|
|
254
256
|
payload = {
|
|
@@ -259,6 +261,7 @@ class MelCloudAta extends EventEmitter {
|
|
|
259
261
|
};
|
|
260
262
|
method = 'POST';
|
|
261
263
|
path = ApiUrlsHome.PostProtectionOverheat;
|
|
264
|
+
update = true;
|
|
262
265
|
break;
|
|
263
266
|
case 'holidaymode':
|
|
264
267
|
payload = {
|
|
@@ -274,6 +277,7 @@ class MelCloudAta extends EventEmitter {
|
|
|
274
277
|
payload = { enabled: deviceData.ScheduleEnabled };
|
|
275
278
|
method = 'PUT';
|
|
276
279
|
path = ApiUrlsHome.PutScheduleEnabled.replace('deviceid', deviceData.DeviceID);
|
|
280
|
+
update = true;
|
|
277
281
|
break;
|
|
278
282
|
case 'scene':
|
|
279
283
|
method = 'PUT';
|
|
@@ -311,6 +315,12 @@ class MelCloudAta extends EventEmitter {
|
|
|
311
315
|
if (this.logDebug) this.emit('debug', `Send data: ${JSON.stringify(payload, null, 2)}`);
|
|
312
316
|
await this.client(path, { method: method, data: payload });
|
|
313
317
|
|
|
318
|
+
if (update) {
|
|
319
|
+
setTimeout(() => {
|
|
320
|
+
this.emit('deviceState', deviceData);
|
|
321
|
+
}, 500);
|
|
322
|
+
}
|
|
323
|
+
|
|
314
324
|
return true;
|
|
315
325
|
default:
|
|
316
326
|
return;
|