homebridge-melcloud-control 4.3.9-beta.13 → 4.3.9-beta.14
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 +1 -1
- package/src/melcloudata.js +12 -8
- package/src/melcloudatw.js +11 -7
- package/src/melclouderv.js +11 -7
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.9-beta.
|
|
4
|
+
"version": "4.3.9-beta.14",
|
|
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
|
@@ -1397,7 +1397,7 @@ class DeviceAta extends EventEmitter {
|
|
|
1397
1397
|
const supportsDry = deviceData.Device[supportDryKey];
|
|
1398
1398
|
const supportsCool1 = deviceData.Device[supportCoolKey];
|
|
1399
1399
|
const supportsCool = this.coolDryFanMode >= 1 && supportsCool1;
|
|
1400
|
-
const numberOfFanSpeeds =
|
|
1400
|
+
const numberOfFanSpeeds = deviceData.Device.NumberOfFanSpeeds;
|
|
1401
1401
|
const minTempHeat = deviceData.Device.MinTempHeat ?? 10;
|
|
1402
1402
|
const maxTempHeat = deviceData.Device.MaxTempHeat ?? 31;
|
|
1403
1403
|
const minTempCoolDryAuto = deviceData.Device.MinTempAutomatic ?? 16;
|
package/src/melcloudata.js
CHANGED
|
@@ -29,14 +29,18 @@ class MelCloudAta extends EventEmitter {
|
|
|
29
29
|
//handle melcloud events
|
|
30
30
|
let deviceData = null;
|
|
31
31
|
melcloud.on('devicesList', async (devicesData) => {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
32
|
+
try {
|
|
33
|
+
this.headers = devicesData.Headers;
|
|
34
|
+
deviceData = devicesData.Devices.find(device => device.DeviceID === this.deviceId);
|
|
35
|
+
if (!deviceData) return;
|
|
36
|
+
deviceData.Scenes = devicesData.Scenes ?? [];
|
|
36
37
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
//update state
|
|
39
|
+
if (!this.logDebug) this.emit('debug', `Request update settings: ${JSON.stringify(deviceData.Device, null, 2)}`);
|
|
40
|
+
await this.updateState(deviceData);
|
|
41
|
+
} catch (error) {
|
|
42
|
+
if (this.logError) this.emit('error', `Request process message error: ${error}`);
|
|
43
|
+
}
|
|
40
44
|
}).on('webSocket', async (parsedMessage) => {
|
|
41
45
|
try {
|
|
42
46
|
const messageData = parsedMessage?.[0]?.Data;
|
|
@@ -323,7 +327,7 @@ class MelCloudAta extends EventEmitter {
|
|
|
323
327
|
//sens payload
|
|
324
328
|
headers['Content-Type'] = 'application/json; charset=utf-8';
|
|
325
329
|
headers.Origin = ApiUrlsHome.Origin;
|
|
326
|
-
if (
|
|
330
|
+
if (this.logDebug) this.emit('debug', `Send Data: ${JSON.stringify(payload, null, 2)}`);
|
|
327
331
|
|
|
328
332
|
await axios(path, {
|
|
329
333
|
method: method,
|
package/src/melcloudatw.js
CHANGED
|
@@ -29,14 +29,18 @@ class MelCloudAtw extends EventEmitter {
|
|
|
29
29
|
//handle melcloud events
|
|
30
30
|
let deviceData = null;
|
|
31
31
|
melcloud.on('devicesList', async (devicesData) => {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
32
|
+
try {
|
|
33
|
+
this.headers = devicesData.Headers;
|
|
34
|
+
deviceData = devicesData.Devices.find(device => device.DeviceID === this.deviceId);
|
|
35
|
+
if (!deviceData) return;
|
|
36
|
+
deviceData.Scenes = devicesData.Scenes ?? [];
|
|
36
37
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
//update state
|
|
39
|
+
if (this.logDebug) this.emit('debug', `Request update settings: ${JSON.stringify(deviceData.Device, null, 2)}`);
|
|
40
|
+
await this.updateState(deviceData);
|
|
41
|
+
} catch (error) {
|
|
42
|
+
if (this.logError) this.emit('error', `Request process message error: ${error}`);
|
|
43
|
+
}
|
|
40
44
|
}).on('webSocket', async (parsedMessage) => {
|
|
41
45
|
try {
|
|
42
46
|
const messageData = parsedMessage?.[0]?.Data;
|
package/src/melclouderv.js
CHANGED
|
@@ -29,14 +29,18 @@ class MelCloudErv extends EventEmitter {
|
|
|
29
29
|
//handle melcloud events
|
|
30
30
|
let deviceData = null;
|
|
31
31
|
melcloud.on('devicesList', async (devicesData) => {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
32
|
+
try {
|
|
33
|
+
this.headers = devicesData.Headers;
|
|
34
|
+
deviceData = devicesData.Devices.find(device => device.DeviceID === this.deviceId);
|
|
35
|
+
if (!deviceData) return;
|
|
36
|
+
deviceData.Scenes = devicesData.Scenes ?? [];
|
|
36
37
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
//update state
|
|
39
|
+
if (this.logDebug) this.emit('debug', `Request update settings: ${JSON.stringify(deviceData.Device, null, 2)}`);
|
|
40
|
+
await this.updateState(deviceData);
|
|
41
|
+
} catch (error) {
|
|
42
|
+
if (this.logError) this.emit('error', `Request process message error: ${error}`);
|
|
43
|
+
}
|
|
40
44
|
}).on('webSocket', async (parsedMessage) => {
|
|
41
45
|
try {
|
|
42
46
|
const messageData = parsedMessage?.[0]?.Data;
|