homebridge-melcloud-control 3.3.12-beta.1 → 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 +18 -17
- 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
|
@@ -243,34 +243,34 @@ class DeviceAta extends EventEmitter {
|
|
|
243
243
|
const fanSpeed = deviceData.Device.FanSpeed;
|
|
244
244
|
const operationMode = deviceData.Device.OperationMode;
|
|
245
245
|
const vaneVerticalDirection = deviceData.Device.VaneVerticalDirection;
|
|
246
|
-
const vaneVerticalSwing = deviceData.Device.
|
|
247
|
-
this.emit('message', `swing v: ${vaneVerticalSwing}`);
|
|
246
|
+
const vaneVerticalSwing = deviceData.Device.VaneVerticalSwing;
|
|
248
247
|
const vaneHorizontalDirection = deviceData.Device.VaneHorizontalDirection;
|
|
249
248
|
const vaneHorizontalSwing = deviceData.Device.VaneHorizontalSwing;
|
|
250
|
-
this.emit('message', `swing h: ${vaneHorizontalSwing}`);
|
|
251
249
|
const prohibitSetTemperature = deviceData.Device.ProhibitSetTemperature ?? false;
|
|
252
250
|
const prohibitOperationMode = deviceData.Device.ProhibitOperationMode ?? false;
|
|
253
251
|
const prohibitPower = deviceData.Device.ProhibitPower ?? false;
|
|
254
252
|
const temperatureIncrement = deviceData.Device.TemperatureIncrement ?? 1;
|
|
255
253
|
const outdoorTemperature = deviceData.Device.OutdoorTemperature;
|
|
256
254
|
|
|
255
|
+
this.emit('message', `Target temp: ${setTemperature}`);
|
|
257
256
|
//accessory
|
|
258
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;
|
|
259
263
|
this.accessory.modelSupportsFanSpeed = modelSupportsFanSpeed;
|
|
260
264
|
this.accessory.modelSupportsAuto = modelSupportsAuto;
|
|
261
265
|
this.accessory.modelSupportsHeat = modelSupportsHeat;
|
|
262
266
|
this.accessory.modelSupportsDry = modelSupportsDry;
|
|
263
267
|
this.accessory.modelSupportsCool = modelSupportsCool;
|
|
264
|
-
this.accessory.hasAutomaticFanSpeed = hasAutomaticFanSpeed;
|
|
265
|
-
this.accessory.hasOutdoorTemperature = hasOutdoorTemperature;
|
|
266
|
-
this.accessory.numberOfFanSpeeds = numberOfFanSpeeds;
|
|
267
|
-
this.accessory.swingFunction = swingFunction;
|
|
268
268
|
this.accessory.power = power ? 1 : 0;
|
|
269
269
|
this.accessory.inStandbyMode = inStandbyMode;
|
|
270
270
|
this.accessory.operationMode = operationMode;
|
|
271
|
-
this.accessory.setTemperature = setTemperature;
|
|
272
271
|
this.accessory.roomTemperature = roomTemperature;
|
|
273
272
|
this.accessory.outdoorTemperature = outdoorTemperature;
|
|
273
|
+
this.accessory.setTemperature = setTemperature;
|
|
274
274
|
this.accessory.defaultHeatingSetTemperature = defaultHeatingSetTemperature;
|
|
275
275
|
this.accessory.defaultCoolingSetTemperature = defaultCoolingSetTemperature;
|
|
276
276
|
this.accessory.actualFanSpeed = actualFanSpeed;
|
|
@@ -307,18 +307,17 @@ class DeviceAta extends EventEmitter {
|
|
|
307
307
|
this.accessory.targetOperationMode = this.autoDryFanMode === 3 ? 0 : this.heatDryFanMode === 3 ? 1 : this.coolDryFanMode === 3 ? 2 : this.accessory.targetOperationMode;
|
|
308
308
|
break;
|
|
309
309
|
case 8: //AUTO
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
const heatingToFan = roomTemperature > defaultHeatingSetTemperature + 1;
|
|
310
|
+
switch (this.accessory.currentOperationMode) {
|
|
311
|
+
case 2: //HEATING
|
|
312
|
+
const heatingToFan = roomTemperature > (defaultHeatingSetTemperature + 1);
|
|
314
313
|
this.accessory.currentOperationMode = heatingToFan ? 1 : 2;
|
|
315
314
|
break;
|
|
316
|
-
case
|
|
317
|
-
const coolingToFan = roomTemperature < defaultCoolingSetTemperature - 1;
|
|
315
|
+
case 3: //COOLING
|
|
316
|
+
const coolingToFan = roomTemperature < (defaultCoolingSetTemperature - 1);
|
|
318
317
|
this.accessory.currentOperationMode = coolingToFan ? 1 : 3;
|
|
319
318
|
break;
|
|
320
319
|
default: //FAN
|
|
321
|
-
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;
|
|
322
321
|
break;
|
|
323
322
|
};
|
|
324
323
|
this.accessory.targetOperationMode = 0;
|
|
@@ -648,7 +647,7 @@ class DeviceAta extends EventEmitter {
|
|
|
648
647
|
const info4 = modelSupportsFanSpeed ? this.emit('message', `Current fan speed: ${CONSTANTS.AirConditioner.FanSpeed[actualFanSpeed]}`) : false;
|
|
649
648
|
const info5 = vaneHorizontalDirection !== null ? this.emit('message', `Vane horizontal: ${CONSTANTS.AirConditioner.HorizontalVane[vaneHorizontalDirection]}`) : false;
|
|
650
649
|
const info6 = vaneVerticalDirection !== null ? this.emit('message', `Vane vertical: ${CONSTANTS.AirConditioner.VerticalVane[vaneVerticalDirection]}`) : false;
|
|
651
|
-
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;
|
|
652
651
|
this.emit('message', `Temperature display unit: ${this.accessory.temperatureUnit}`);
|
|
653
652
|
this.emit('message', `Lock physical controls: ${this.accessory.lockPhysicalControl ? 'LOCKED' : 'UNLOCKED'}`);
|
|
654
653
|
};
|
|
@@ -922,7 +921,7 @@ class DeviceAta extends EventEmitter {
|
|
|
922
921
|
deviceData.Device.VaneVertical = value ? 7 : 0;
|
|
923
922
|
deviceData.Device.EffectiveFlags = CONSTANTS.AirConditioner.EffectiveFlags.VaneHorizontal + CONSTANTS.AirConditioner.EffectiveFlags.VaneVertical;
|
|
924
923
|
await this.melCloudAta.send(deviceData);
|
|
925
|
-
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]}`);
|
|
926
925
|
} catch (error) {
|
|
927
926
|
this.emit('warn', `Set vane swing mode error: ${error}`);
|
|
928
927
|
};
|
|
@@ -1014,6 +1013,7 @@ class DeviceAta extends EventEmitter {
|
|
|
1014
1013
|
try {
|
|
1015
1014
|
accountInfo.UseFahrenheit = [false, true][value];
|
|
1016
1015
|
await this.melCloud.send(accountInfo);
|
|
1016
|
+
this.accessory.useFahrenheit = value;
|
|
1017
1017
|
const info = this.disableLogInfo ? false : this.emit('message', `Set temperature display unit: ${CONSTANTS.TemperatureDisplayUnits[value]}`);
|
|
1018
1018
|
} catch (error) {
|
|
1019
1019
|
this.emit('warn', `Set temperature display unit error: ${error}`);
|
|
@@ -1150,6 +1150,7 @@ class DeviceAta extends EventEmitter {
|
|
|
1150
1150
|
try {
|
|
1151
1151
|
accountInfo.UseFahrenheit = [false, true][value];
|
|
1152
1152
|
await this.melCloud.send(accountInfo);
|
|
1153
|
+
this.accessory.useFahrenheit = value;
|
|
1153
1154
|
const info = this.disableLogInfo ? false : this.emit('message', `Set temperature display unit: ${CONSTANTS.TemperatureDisplayUnits[value]}`);
|
|
1154
1155
|
} catch (error) {
|
|
1155
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
|