homebridge-melcloud-control 3.3.21-beta.4 → 3.3.21-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 +1 -1
- package/src/constants.json +7 -7
- package/src/deviceata.js +2 -2
- package/src/melcloudata.js +15 -6
- package/src/melcloudatw.js +8 -1
- package/src/melclouderv.js +8 -1
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.21-beta.
|
|
4
|
+
"version": "3.3.21-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",
|
package/src/constants.json
CHANGED
package/src/deviceata.js
CHANGED
|
@@ -597,8 +597,8 @@ class DeviceAta extends EventEmitter {
|
|
|
597
597
|
const info = hasOutdoorTemperature && outdoorTemperature !== null ? this.emit('message', `Outdoor temperature: ${outdoorTemperature}${this.accessory.temperatureUnit}`) : false;
|
|
598
598
|
const info3 = modelSupportsFanSpeed ? this.emit('message', `Target fan speed: ${CONSTANTS.AirConditioner.FanSpeed[fanSpeed]}`) : false;
|
|
599
599
|
const info4 = modelSupportsFanSpeed ? this.emit('message', `Current fan speed: ${CONSTANTS.AirConditioner.FanSpeed[actualFanSpeed]}`) : false;
|
|
600
|
-
const info5 = vaneHorizontalDirection !== null ? this.emit('message', `Vane horizontal: ${CONSTANTS.AirConditioner.HorizontalVane[vaneHorizontalDirection]}`) : false;
|
|
601
|
-
const info6 = vaneVerticalDirection !== null ? this.emit('message', `Vane vertical: ${CONSTANTS.AirConditioner.VerticalVane[vaneVerticalDirection]}`) : false;
|
|
600
|
+
const info5 = vaneHorizontalDirection !== null ? this.emit('message', `Vane horizontal: ${CONSTANTS.AirConditioner.HorizontalVane[vaneHorizontalDirection] ?? vaneHorizontalDirection}`) : false;
|
|
601
|
+
const info6 = vaneVerticalDirection !== null ? this.emit('message', `Vane vertical: ${CONSTANTS.AirConditioner.VerticalVane[vaneVerticalDirection] ?? vaneVerticalDirection}`) : false;
|
|
602
602
|
const info7 = swingFunction ? this.emit('message', `Air direction: ${CONSTANTS.AirConditioner.AirDirection[this.accessory.swingMode]}`) : false;
|
|
603
603
|
this.emit('message', `Temperature display unit: ${this.accessory.temperatureUnit}`);
|
|
604
604
|
this.emit('message', `Lock physical controls: ${this.accessory.lockPhysicalControl ? 'LOCKED' : 'UNLOCKED'}`);
|
package/src/melcloudata.js
CHANGED
|
@@ -334,18 +334,20 @@ class MelCloudAta extends EventEmitter {
|
|
|
334
334
|
}
|
|
335
335
|
|
|
336
336
|
//check state changes
|
|
337
|
-
const
|
|
338
|
-
|
|
339
|
-
|
|
337
|
+
const deviceDataHasNotChanged = JSON.stringify(deviceState) === JSON.stringify(this.deviceState);
|
|
338
|
+
if (deviceDataHasNotChanged) {
|
|
339
|
+
return;
|
|
340
|
+
}
|
|
341
|
+
this.deviceState = deviceState;
|
|
340
342
|
|
|
341
343
|
//external integrations
|
|
342
|
-
this.emit('externalIntegrations',
|
|
344
|
+
this.emit('externalIntegrations', deviceData);
|
|
343
345
|
|
|
344
346
|
//emit info
|
|
345
347
|
this.emit('deviceInfo', manufacturer, modelIndoor, modelOutdoor, serialNumber, firmwareAppVersion);
|
|
346
348
|
|
|
347
349
|
//emit state
|
|
348
|
-
this.emit('deviceState',
|
|
350
|
+
this.emit('deviceState', deviceData);
|
|
349
351
|
|
|
350
352
|
return true;
|
|
351
353
|
} catch (error) {
|
|
@@ -423,11 +425,18 @@ class MelCloudAta extends EventEmitter {
|
|
|
423
425
|
}
|
|
424
426
|
|
|
425
427
|
await this.axiosInstancePost(CONSTANTS.ApiUrls.SetAta, payload);
|
|
426
|
-
this.deviceData
|
|
428
|
+
this.updateData(deviceData);
|
|
427
429
|
return true;
|
|
428
430
|
} catch (error) {
|
|
429
431
|
throw new Error(`Send data error: ${error.message || error}`);
|
|
430
432
|
};
|
|
431
433
|
};
|
|
434
|
+
|
|
435
|
+
updateData(deviceData) {
|
|
436
|
+
setTimeout(() => {
|
|
437
|
+
this.emit('externalIntegrations', deviceData);
|
|
438
|
+
this.emit('deviceState', deviceData);
|
|
439
|
+
}, 500);
|
|
440
|
+
}
|
|
432
441
|
};
|
|
433
442
|
module.exports = MelCloudAta;
|
package/src/melcloudatw.js
CHANGED
|
@@ -470,11 +470,18 @@ class MelCloudAtw extends EventEmitter {
|
|
|
470
470
|
}
|
|
471
471
|
|
|
472
472
|
await this.axiosInstancePost(CONSTANTS.ApiUrls.SetAtw, payload);
|
|
473
|
-
this.
|
|
473
|
+
this.updateData(deviceData);
|
|
474
474
|
return true;
|
|
475
475
|
} catch (error) {
|
|
476
476
|
throw new Error(`Send data error: ${error.message || error}`);
|
|
477
477
|
};
|
|
478
478
|
};
|
|
479
|
+
|
|
480
|
+
updateData(deviceData) {
|
|
481
|
+
setTimeout(() => {
|
|
482
|
+
this.emit('externalIntegrations', deviceData);
|
|
483
|
+
this.emit('deviceState', deviceData);
|
|
484
|
+
}, 500);
|
|
485
|
+
}
|
|
479
486
|
};
|
|
480
487
|
module.exports = MelCloudAtw;
|
package/src/melclouderv.js
CHANGED
|
@@ -396,11 +396,18 @@ class MelCloudErv extends EventEmitter {
|
|
|
396
396
|
}
|
|
397
397
|
|
|
398
398
|
await this.axiosInstancePost(CONSTANTS.ApiUrls.SetErv, payload);
|
|
399
|
-
this.
|
|
399
|
+
this.updateData(deviceData);
|
|
400
400
|
return true;
|
|
401
401
|
} catch (error) {
|
|
402
402
|
throw new Error(`Send data error: ${error.message || error}`);
|
|
403
403
|
};
|
|
404
404
|
};
|
|
405
|
+
|
|
406
|
+
updateData(deviceData) {
|
|
407
|
+
setTimeout(() => {
|
|
408
|
+
this.emit('externalIntegrations', deviceData);
|
|
409
|
+
this.emit('deviceState', deviceData);
|
|
410
|
+
}, 500);
|
|
411
|
+
}
|
|
405
412
|
};
|
|
406
413
|
module.exports = MelCloudErv;
|