homebridge-melcloud-control 4.0.0-beta.525 → 4.0.0-beta.528
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 +8 -6
- package/src/deviceerv.js +3 -1
- package/src/melcloudata.js +5 -5
- package/src/melcloudatw.js +5 -5
- package/src/melclouderv.js +5 -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.0.0-beta.
|
|
4
|
+
"version": "4.0.0-beta.528",
|
|
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
|
@@ -233,7 +233,7 @@ class DeviceAtw extends EventEmitter {
|
|
|
233
233
|
this.emit('warn', `${integration}, received key: ${key}, value: ${value}`);
|
|
234
234
|
break;
|
|
235
235
|
};
|
|
236
|
-
|
|
236
|
+
|
|
237
237
|
set = await this.melCloudAtw.send(this.accountType, this.displayType, deviceData, effectiveFlags);
|
|
238
238
|
return set;
|
|
239
239
|
} catch (error) {
|
|
@@ -306,10 +306,12 @@ class DeviceAtw extends EventEmitter {
|
|
|
306
306
|
return state;
|
|
307
307
|
})
|
|
308
308
|
.onSet(async (state) => {
|
|
309
|
+
if (!!state === deviceData.Device.Power) return;
|
|
310
|
+
|
|
309
311
|
try {
|
|
310
312
|
switch (i) {
|
|
311
313
|
case 0: //Heat Pump
|
|
312
|
-
deviceData.Device.Power =
|
|
314
|
+
deviceData.Device.Power = state ? true : false;
|
|
313
315
|
await this.melCloudAtw.send(this.accountType, this.displayType, deviceData, HeatPump.EffectiveFlags.Power);
|
|
314
316
|
if (this.logInfo) this.emit('info', `${zoneName}, Set power: ${state ? 'ON' : 'OFF'}`);
|
|
315
317
|
break;
|
|
@@ -484,8 +486,8 @@ class DeviceAtw extends EventEmitter {
|
|
|
484
486
|
break;
|
|
485
487
|
};
|
|
486
488
|
|
|
487
|
-
|
|
488
|
-
|
|
489
|
+
if (i > 0) await this.melCloudAtw.send(this.accountType, this.displayType, deviceData, effectiveFlags);
|
|
490
|
+
if (this.logInfo && i !== 0) this.emit('info', `${zoneName}, Set cooling threshold temperature: ${value}${this.accessory.temperatureUnit}`);
|
|
489
491
|
} catch (error) {
|
|
490
492
|
if (this.logWarn) this.emit('warn', `${zoneName}, Set cooling threshold temperature error: ${error}`);
|
|
491
493
|
};
|
|
@@ -549,8 +551,8 @@ class DeviceAtw extends EventEmitter {
|
|
|
549
551
|
break;
|
|
550
552
|
};
|
|
551
553
|
|
|
552
|
-
|
|
553
|
-
|
|
554
|
+
if (i > 0) await this.melCloudAtw.send(this.accountType, this.displayType, deviceData, effectiveFlags);
|
|
555
|
+
if (this.logInfo && i !== 0) this.emit('info', `${zoneName}, Set heating threshold temperature: ${value}${this.accessory.temperatureUnit}`);
|
|
554
556
|
} catch (error) {
|
|
555
557
|
if (this.logWarn) this.emit('warn', `${zoneName}, Set heating threshold temperature error: ${error}`);
|
|
556
558
|
};
|
package/src/deviceerv.js
CHANGED
|
@@ -270,8 +270,10 @@ class DeviceErv extends EventEmitter {
|
|
|
270
270
|
return state;
|
|
271
271
|
})
|
|
272
272
|
.onSet(async (state) => {
|
|
273
|
+
if (!!state === deviceData.Device.Power) return;
|
|
274
|
+
|
|
273
275
|
try {
|
|
274
|
-
deviceData.Device.Power =
|
|
276
|
+
deviceData.Device.Power = state ? true : false;
|
|
275
277
|
await this.melCloudErv.send(this.accountType, this.displayType, deviceData, Ventilation.EffectiveFlags.Power);
|
|
276
278
|
if (this.logInfo) this.emit('info', `Set power: ${state ? 'ON' : 'OFF'}`);
|
|
277
279
|
} catch (error) {
|
package/src/melcloudata.js
CHANGED
|
@@ -8,10 +8,10 @@ class MelCloudAta extends EventEmitter {
|
|
|
8
8
|
constructor(account, device, devicesFile, defaultTempsFile) {
|
|
9
9
|
super();
|
|
10
10
|
this.accountType = account.type;
|
|
11
|
+
this.logWarn = account.log?.warn;
|
|
12
|
+
this.logError = account.log?.error;
|
|
13
|
+
this.logDebug = account.log?.debug;
|
|
11
14
|
this.deviceId = device.id;
|
|
12
|
-
this.logWarn = device.log?.warn;
|
|
13
|
-
this.logError = device.log?.error;
|
|
14
|
-
this.logDebug = device.log?.debug;
|
|
15
15
|
this.devicesFile = devicesFile;
|
|
16
16
|
this.defaultTempsFile = defaultTempsFile;
|
|
17
17
|
this.functions = new Functions(this.logWarn, this.logError, this.logDebug)
|
|
@@ -59,8 +59,8 @@ class MelCloudAta extends EventEmitter {
|
|
|
59
59
|
}
|
|
60
60
|
const deviceData = devicesData.find(device => device.DeviceID === this.deviceId);
|
|
61
61
|
if (this.accountType === 'melcloudhome') {
|
|
62
|
-
deviceData.SerialNumber = deviceData.
|
|
63
|
-
deviceData.Device.FirmwareAppVersion = '4.0.0';
|
|
62
|
+
deviceData.SerialNumber = deviceData.DeviceID || '4.0.0';
|
|
63
|
+
deviceData.Device.FirmwareAppVersion = deviceData.ConnectedInterfaceIdentifier || '4.0.0';
|
|
64
64
|
deviceData.Device.OperationMode = AirConditioner.OperationModeMapStringToEnum[deviceData.Device.OperationMode] ?? deviceData.Device.OperationMode;
|
|
65
65
|
deviceData.Device.ActualFanSpeed = AirConditioner.FanSpeedMapStringToEnum[deviceData.Device.ActualFanSpeed] ?? deviceData.Device.ActualFanSpeed;
|
|
66
66
|
deviceData.Device.SetFanSpeed = AirConditioner.FanSpeedMapStringToEnum[deviceData.Device.SetFanSpeed] ?? deviceData.Device.SetFanSpeed;
|
package/src/melcloudatw.js
CHANGED
|
@@ -8,10 +8,10 @@ class MelCloudAtw extends EventEmitter {
|
|
|
8
8
|
constructor(account, device, devicesFile, defaultTempsFile) {
|
|
9
9
|
super();
|
|
10
10
|
this.accountType = account.type;
|
|
11
|
+
this.logWarn = account.log?.warn;
|
|
12
|
+
this.logError = account.log?.error;
|
|
13
|
+
this.logDebug = account.log?.debug;
|
|
11
14
|
this.deviceId = device.id;
|
|
12
|
-
this.logWarn = device.log?.warn;
|
|
13
|
-
this.logError = device.log?.error;
|
|
14
|
-
this.logDebug = device.log?.debug;
|
|
15
15
|
this.devicesFile = devicesFile;
|
|
16
16
|
this.defaultTempsFile = defaultTempsFile;
|
|
17
17
|
this.functions = new Functions(this.logWarn, this.logError, this.logDebug)
|
|
@@ -59,8 +59,8 @@ class MelCloudAtw extends EventEmitter {
|
|
|
59
59
|
}
|
|
60
60
|
const deviceData = devicesData.find(device => device.DeviceID === this.deviceId);
|
|
61
61
|
if (this.accountType === 'melcloudhome') {
|
|
62
|
-
deviceData.SerialNumber = deviceData.
|
|
63
|
-
deviceData.Device.FirmwareAppVersion = '4.0.0';
|
|
62
|
+
deviceData.SerialNumber = deviceData.DeviceID || '4.0.0';
|
|
63
|
+
deviceData.Device.FirmwareAppVersion = deviceData.ConnectedInterfaceIdentifier || '4.0.0';
|
|
64
64
|
}
|
|
65
65
|
if (this.logDebug) this.emit('debug', `Device Data: ${JSON.stringify(deviceData, null, 2)}`);
|
|
66
66
|
|
package/src/melclouderv.js
CHANGED
|
@@ -8,10 +8,10 @@ class MelCloudErv extends EventEmitter {
|
|
|
8
8
|
constructor(account, device, devicesFile, defaultTempsFile) {
|
|
9
9
|
super();
|
|
10
10
|
this.accountType = account.type;
|
|
11
|
+
this.logWarn = account.log?.warn;
|
|
12
|
+
this.logError = account.log?.error;
|
|
13
|
+
this.logDebug = account.log?.debug;
|
|
11
14
|
this.deviceId = device.id;
|
|
12
|
-
this.logWarn = device.log?.warn;
|
|
13
|
-
this.logError = device.log?.error;
|
|
14
|
-
this.logDebug = device.log?.debug;
|
|
15
15
|
this.devicesFile = devicesFile;
|
|
16
16
|
this.defaultTempsFile = defaultTempsFile;
|
|
17
17
|
this.functions = new Functions(this.logWarn, this.logError, this.logDebug)
|
|
@@ -59,8 +59,8 @@ class MelCloudErv extends EventEmitter {
|
|
|
59
59
|
}
|
|
60
60
|
const deviceData = devicesData.find(device => device.DeviceID === this.deviceId);
|
|
61
61
|
if (this.accountType === 'melcloudhome') {
|
|
62
|
-
deviceData.SerialNumber = deviceData.
|
|
63
|
-
deviceData.Device.FirmwareAppVersion = '4.0.0';
|
|
62
|
+
deviceData.SerialNumber = deviceData.DeviceID || '4.0.0';
|
|
63
|
+
deviceData.Device.FirmwareAppVersion = deviceData.ConnectedInterfaceIdentifier || '4.0.0';
|
|
64
64
|
}
|
|
65
65
|
if (this.logDebug) this.emit('debug', `Device Data: ${JSON.stringify(deviceData, null, 2)}`);
|
|
66
66
|
|