homebridge-melcloud-control 4.3.0-beta.36 → 4.3.0-beta.38
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/melcloudata.js +6 -5
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"displayName": "MELCloud Control",
|
|
3
3
|
"name": "homebridge-melcloud-control",
|
|
4
|
-
"version": "4.3.0-beta.
|
|
4
|
+
"version": "4.3.0-beta.38",
|
|
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/melcloudata.js
CHANGED
|
@@ -275,7 +275,7 @@ class MelCloudAta extends EventEmitter {
|
|
|
275
275
|
headers: this.headers,
|
|
276
276
|
data: payload
|
|
277
277
|
});
|
|
278
|
-
this.updateData(deviceData);
|
|
278
|
+
this.updateData(deviceData, updateState);
|
|
279
279
|
return true;
|
|
280
280
|
case "melcloudhome":
|
|
281
281
|
switch (flag) {
|
|
@@ -349,11 +349,12 @@ class MelCloudAta extends EventEmitter {
|
|
|
349
349
|
method = 'PUT';
|
|
350
350
|
path = ApiUrlsHome.PutAta.replace('deviceid', deviceData.DeviceID);
|
|
351
351
|
this.headers.Referer = ApiUrlsHome.Referers.PutDeviceSettings;
|
|
352
|
+
updateState = false;
|
|
353
|
+
break;
|
|
352
354
|
}
|
|
353
355
|
|
|
354
356
|
this.headers['Content-Type'] = 'application/json; charset=utf-8';
|
|
355
357
|
this.headers.Origin = ApiUrlsHome.Origin;
|
|
356
|
-
updateState = false;
|
|
357
358
|
if (this.logDebug) this.emit('debug', `Send Data: ${JSON.stringify(payload, null, 2)}`);
|
|
358
359
|
await axios(path, {
|
|
359
360
|
method: method,
|
|
@@ -363,7 +364,7 @@ class MelCloudAta extends EventEmitter {
|
|
|
363
364
|
data: payload
|
|
364
365
|
});
|
|
365
366
|
|
|
366
|
-
|
|
367
|
+
this.updateData(deviceData, updateState);
|
|
367
368
|
return true;
|
|
368
369
|
default:
|
|
369
370
|
return;
|
|
@@ -374,9 +375,9 @@ class MelCloudAta extends EventEmitter {
|
|
|
374
375
|
}
|
|
375
376
|
}
|
|
376
377
|
|
|
377
|
-
updateData(deviceData) {
|
|
378
|
+
updateData(deviceData, updateState = true) {
|
|
378
379
|
this.locks = true;
|
|
379
|
-
this.emit('deviceState', deviceData);
|
|
380
|
+
if (updateState) this.emit('deviceState', deviceData);
|
|
380
381
|
|
|
381
382
|
setTimeout(() => {
|
|
382
383
|
this.locks = false
|