homebridge-melcloud-control 3.3.12-beta.0 → 3.3.12-beta.10
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 +0 -6
- package/src/deviceata.js +19 -16
- package/src/deviceatw.js +4 -3
- package/src/deviceerv.js +2 -0
- package/src/melcloudata.js +1 -1
- package/src/melcloudatw.js +1 -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.12-beta.
|
|
4
|
+
"version": "3.3.12-beta.10",
|
|
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
|
@@ -242,8 +242,8 @@ class DeviceAta extends EventEmitter {
|
|
|
242
242
|
const automaticFanSpeed = deviceData.Device.AutomaticFanSpeed;
|
|
243
243
|
const fanSpeed = deviceData.Device.FanSpeed;
|
|
244
244
|
const operationMode = deviceData.Device.OperationMode;
|
|
245
|
-
const vaneVerticalDirection = deviceData.Device.
|
|
246
|
-
const vaneVerticalSwing = deviceData.Device.
|
|
245
|
+
const vaneVerticalDirection = deviceData.Device.VaneVerticalDirection;
|
|
246
|
+
const vaneVerticalSwing = deviceData.Device.VaneVerticalSwing;
|
|
247
247
|
const vaneHorizontalDirection = deviceData.Device.VaneHorizontalDirection;
|
|
248
248
|
const vaneHorizontalSwing = deviceData.Device.VaneHorizontalSwing;
|
|
249
249
|
const prohibitSetTemperature = deviceData.Device.ProhibitSetTemperature ?? false;
|
|
@@ -252,23 +252,25 @@ class DeviceAta extends EventEmitter {
|
|
|
252
252
|
const temperatureIncrement = deviceData.Device.TemperatureIncrement ?? 1;
|
|
253
253
|
const outdoorTemperature = deviceData.Device.OutdoorTemperature;
|
|
254
254
|
|
|
255
|
+
this.emit('message', `Target temp: ${setTemperature}`);
|
|
255
256
|
//accessory
|
|
256
257
|
this.accessory.presets = presetsOnServer;
|
|
258
|
+
this.accessory.hasAutomaticFanSpeed = hasAutomaticFanSpeed;
|
|
259
|
+
this.accessory.airDirectionFunction = airDirectionFunction;
|
|
260
|
+
this.accessory.swingFunction = swingFunction;
|
|
261
|
+
this.accessory.hasOutdoorTemperature = hasOutdoorTemperature;
|
|
262
|
+
this.accessory.numberOfFanSpeeds = numberOfFanSpeeds;
|
|
257
263
|
this.accessory.modelSupportsFanSpeed = modelSupportsFanSpeed;
|
|
258
264
|
this.accessory.modelSupportsAuto = modelSupportsAuto;
|
|
259
265
|
this.accessory.modelSupportsHeat = modelSupportsHeat;
|
|
260
266
|
this.accessory.modelSupportsDry = modelSupportsDry;
|
|
261
267
|
this.accessory.modelSupportsCool = modelSupportsCool;
|
|
262
|
-
this.accessory.hasAutomaticFanSpeed = hasAutomaticFanSpeed;
|
|
263
|
-
this.accessory.hasOutdoorTemperature = hasOutdoorTemperature;
|
|
264
|
-
this.accessory.numberOfFanSpeeds = numberOfFanSpeeds;
|
|
265
|
-
this.accessory.swingFunction = swingFunction;
|
|
266
268
|
this.accessory.power = power ? 1 : 0;
|
|
267
269
|
this.accessory.inStandbyMode = inStandbyMode;
|
|
268
270
|
this.accessory.operationMode = operationMode;
|
|
269
|
-
this.accessory.setTemperature = setTemperature;
|
|
270
271
|
this.accessory.roomTemperature = roomTemperature;
|
|
271
272
|
this.accessory.outdoorTemperature = outdoorTemperature;
|
|
273
|
+
this.accessory.setTemperature = setTemperature;
|
|
272
274
|
this.accessory.defaultHeatingSetTemperature = defaultHeatingSetTemperature;
|
|
273
275
|
this.accessory.defaultCoolingSetTemperature = defaultCoolingSetTemperature;
|
|
274
276
|
this.accessory.actualFanSpeed = actualFanSpeed;
|
|
@@ -305,18 +307,17 @@ class DeviceAta extends EventEmitter {
|
|
|
305
307
|
this.accessory.targetOperationMode = this.autoDryFanMode === 3 ? 0 : this.heatDryFanMode === 3 ? 1 : this.coolDryFanMode === 3 ? 2 : this.accessory.targetOperationMode;
|
|
306
308
|
break;
|
|
307
309
|
case 8: //AUTO
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
const heatingToFan = roomTemperature > defaultHeatingSetTemperature + 1;
|
|
310
|
+
switch (this.accessory.currentOperationMode) {
|
|
311
|
+
case 2: //HEATING
|
|
312
|
+
const heatingToFan = roomTemperature > (defaultHeatingSetTemperature + 1);
|
|
312
313
|
this.accessory.currentOperationMode = heatingToFan ? 1 : 2;
|
|
313
314
|
break;
|
|
314
|
-
case
|
|
315
|
-
const coolingToFan = roomTemperature < defaultCoolingSetTemperature - 1;
|
|
315
|
+
case 3: //COOLING
|
|
316
|
+
const coolingToFan = roomTemperature < (defaultCoolingSetTemperature - 1);
|
|
316
317
|
this.accessory.currentOperationMode = coolingToFan ? 1 : 3;
|
|
317
318
|
break;
|
|
318
319
|
default: //FAN
|
|
319
|
-
this.accessory.currentOperationMode = roomTemperature <= defaultHeatingSetTemperature ? 2 : roomTemperature
|
|
320
|
+
this.accessory.currentOperationMode = roomTemperature >= defaultHeatingSetTemperature && roomTemperature <= defaultCoolingSetTemperature ? 1 : roomTemperature < defaultHeatingSetTemperature ? 2 : roomTemperature > defaultCoolingSetTemperature ? 3 : this.accessory.currentOperationMode;
|
|
320
321
|
break;
|
|
321
322
|
};
|
|
322
323
|
this.accessory.targetOperationMode = 0;
|
|
@@ -646,7 +647,7 @@ class DeviceAta extends EventEmitter {
|
|
|
646
647
|
const info4 = modelSupportsFanSpeed ? this.emit('message', `Current fan speed: ${CONSTANTS.AirConditioner.FanSpeed[actualFanSpeed]}`) : false;
|
|
647
648
|
const info5 = vaneHorizontalDirection !== null ? this.emit('message', `Vane horizontal: ${CONSTANTS.AirConditioner.HorizontalVane[vaneHorizontalDirection]}`) : false;
|
|
648
649
|
const info6 = vaneVerticalDirection !== null ? this.emit('message', `Vane vertical: ${CONSTANTS.AirConditioner.VerticalVane[vaneVerticalDirection]}`) : false;
|
|
649
|
-
const info7 = swingFunction ? this.emit('message', `Air direction: ${CONSTANTS.AirConditioner.AirDirection[this.accessory.swingMode
|
|
650
|
+
const info7 = swingFunction ? this.emit('message', `Air direction: ${CONSTANTS.AirConditioner.AirDirection[this.accessory.swingMode]}`) : false;
|
|
650
651
|
this.emit('message', `Temperature display unit: ${this.accessory.temperatureUnit}`);
|
|
651
652
|
this.emit('message', `Lock physical controls: ${this.accessory.lockPhysicalControl ? 'LOCKED' : 'UNLOCKED'}`);
|
|
652
653
|
};
|
|
@@ -920,7 +921,7 @@ class DeviceAta extends EventEmitter {
|
|
|
920
921
|
deviceData.Device.VaneVertical = value ? 7 : 0;
|
|
921
922
|
deviceData.Device.EffectiveFlags = CONSTANTS.AirConditioner.EffectiveFlags.VaneHorizontal + CONSTANTS.AirConditioner.EffectiveFlags.VaneVertical;
|
|
922
923
|
await this.melCloudAta.send(deviceData);
|
|
923
|
-
const info = this.disableLogInfo ? false : this.emit('message', `Set air direction mode: ${CONSTANTS.AirConditioner.AirDirection[value
|
|
924
|
+
const info = this.disableLogInfo ? false : this.emit('message', `Set air direction mode: ${CONSTANTS.AirConditioner.AirDirection[value]}`);
|
|
924
925
|
} catch (error) {
|
|
925
926
|
this.emit('warn', `Set vane swing mode error: ${error}`);
|
|
926
927
|
};
|
|
@@ -1012,6 +1013,7 @@ class DeviceAta extends EventEmitter {
|
|
|
1012
1013
|
try {
|
|
1013
1014
|
accountInfo.UseFahrenheit = [false, true][value];
|
|
1014
1015
|
await this.melCloud.send(accountInfo);
|
|
1016
|
+
this.accessory.useFahrenheit = value;
|
|
1015
1017
|
const info = this.disableLogInfo ? false : this.emit('message', `Set temperature display unit: ${CONSTANTS.TemperatureDisplayUnits[value]}`);
|
|
1016
1018
|
} catch (error) {
|
|
1017
1019
|
this.emit('warn', `Set temperature display unit error: ${error}`);
|
|
@@ -1148,6 +1150,7 @@ class DeviceAta extends EventEmitter {
|
|
|
1148
1150
|
try {
|
|
1149
1151
|
accountInfo.UseFahrenheit = [false, true][value];
|
|
1150
1152
|
await this.melCloud.send(accountInfo);
|
|
1153
|
+
this.accessory.useFahrenheit = value;
|
|
1151
1154
|
const info = this.disableLogInfo ? false : this.emit('message', `Set temperature display unit: ${CONSTANTS.TemperatureDisplayUnits[value]}`);
|
|
1152
1155
|
} catch (error) {
|
|
1153
1156
|
this.emit('warn', `Set temperature display unit error: ${error}`);
|
package/src/deviceatw.js
CHANGED
|
@@ -213,9 +213,8 @@ class DeviceAtw extends EventEmitter {
|
|
|
213
213
|
this.displayDeviceInfo = false;
|
|
214
214
|
})
|
|
215
215
|
.on('deviceState', async (deviceData) => {
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
216
|
+
//presets
|
|
217
|
+
const presetsOnServer = deviceData.Presets ?? [];
|
|
219
218
|
//device info
|
|
220
219
|
const heatPumpName = 'Heat Pump';
|
|
221
220
|
const hotWaterName = 'Hot Water';
|
|
@@ -1257,6 +1256,7 @@ class DeviceAtw extends EventEmitter {
|
|
|
1257
1256
|
try {
|
|
1258
1257
|
accountInfo.UseFahrenheit = [false, true][value];
|
|
1259
1258
|
await this.melCloud.send(accountInfo);
|
|
1259
|
+
this.accessory.useFahrenheit = value;
|
|
1260
1260
|
const info = this.disableLogInfo ? false : this.emit('message', `Set temperature display unit: ${CONSTANTS.TemperatureDisplayUnits[value]}`);
|
|
1261
1261
|
} catch (error) {
|
|
1262
1262
|
this.emit('warn', `Set temperature display unit error: ${error}`);
|
|
@@ -1549,6 +1549,7 @@ class DeviceAtw extends EventEmitter {
|
|
|
1549
1549
|
try {
|
|
1550
1550
|
accountInfo.UseFahrenheit = [false, true][value];
|
|
1551
1551
|
await this.melCloud.send(accountInfo);
|
|
1552
|
+
this.accessory.useFahrenheit = value;
|
|
1552
1553
|
const info = this.disableLogInfo ? false : this.emit('message', `Set temperature display unit: ${CONSTANTS.TemperatureDisplayUnits[value]}`);
|
|
1553
1554
|
} catch (error) {
|
|
1554
1555
|
this.emit('warn', `Set temperature display unit error: ${error}`);
|
package/src/deviceerv.js
CHANGED
|
@@ -879,6 +879,7 @@ class DeviceErv extends EventEmitter {
|
|
|
879
879
|
try {
|
|
880
880
|
accountInfo.UseFahrenheit = [false, true][value];
|
|
881
881
|
await this.melCloud.send(accountInfo);
|
|
882
|
+
this.accessory.useFahrenheit = value;
|
|
882
883
|
const info = this.disableLogInfo ? false : this.emit('message', `Set temperature display unit: ${CONSTANTS.TemperatureDisplayUnits[value]}`);
|
|
883
884
|
} catch (error) {
|
|
884
885
|
this.emit('warn', `Set temperature display unit error: ${error}`);
|
|
@@ -1015,6 +1016,7 @@ class DeviceErv extends EventEmitter {
|
|
|
1015
1016
|
try {
|
|
1016
1017
|
accountInfo.UseFahrenheit = [false, true][value];
|
|
1017
1018
|
await this.melCloud.send(accountInfo);
|
|
1019
|
+
this.accessory.useFahrenheit = value;
|
|
1018
1020
|
const info = this.disableLogInfo ? false : this.emit('message', `Set temperature display unit: ${CONSTANTS.TemperatureDisplayUnits[value]}`);
|
|
1019
1021
|
} catch (error) {
|
|
1020
1022
|
this.emit('warn', `Set temperature display unit error: ${error}`);
|
package/src/melcloudata.js
CHANGED
|
@@ -331,7 +331,7 @@ class MelCloudAta extends EventEmitter {
|
|
|
331
331
|
ProhibitSetTemperature: prohibitSetTemperature,
|
|
332
332
|
ProhibitOperationMode: prohibitOperationMode,
|
|
333
333
|
ProhibitPower: prohibitPower,
|
|
334
|
-
EffectiveFlags:effectiveFlags
|
|
334
|
+
EffectiveFlags: effectiveFlags
|
|
335
335
|
}
|
|
336
336
|
|
|
337
337
|
//check state changes
|
package/src/melcloudatw.js
CHANGED
|
@@ -396,7 +396,7 @@ class MelCloudAtw extends EventEmitter {
|
|
|
396
396
|
ProhibitZone1: prohibitHeatingZone1,
|
|
397
397
|
ProhibitZone2: prohibitHeatingZone2,
|
|
398
398
|
ProhibitHotWater: prohibitHotWater,
|
|
399
|
-
EffectiveFlags:effectiveFlags
|
|
399
|
+
EffectiveFlags: effectiveFlags
|
|
400
400
|
}
|
|
401
401
|
|
|
402
402
|
//check state changes
|