homebridge-melcloud-control 4.0.0-beta.185 → 4.0.0-beta.186
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 +3 -1
- package/src/melcloudata.js +21 -20
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.186",
|
|
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
|
@@ -320,16 +320,18 @@ class DeviceAta extends EventEmitter {
|
|
|
320
320
|
switch (value) {
|
|
321
321
|
case 0: //AUTO - AUTO
|
|
322
322
|
value = autoDryFanMode;
|
|
323
|
+
deviceData.Device.OperationMode = value;
|
|
323
324
|
break;
|
|
324
325
|
case 1: //HEAT - HEAT
|
|
325
326
|
value = heatDryFanMode;
|
|
327
|
+
deviceData.Device.OperationMode = value;
|
|
326
328
|
break;
|
|
327
329
|
case 2: //COOL - COOL
|
|
328
330
|
value = coolDryFanMode;
|
|
331
|
+
deviceData.Device.OperationMode = value;
|
|
329
332
|
break;
|
|
330
333
|
};
|
|
331
334
|
|
|
332
|
-
deviceData.Device.OperationMode = value;
|
|
333
335
|
deviceData.Device.EffectiveFlags = AirConditioner.EffectiveFlags.OperationMode;
|
|
334
336
|
await this.melCloudAta.send(this.accountType, this.displayMode, deviceData);
|
|
335
337
|
if (this.logInfo) this.emit('info', `Set operation mode: ${AirConditioner.OperationModeMapEnumToString[value]}`);
|
package/src/melcloudata.js
CHANGED
|
@@ -264,34 +264,35 @@ class MelCloudAta extends EventEmitter {
|
|
|
264
264
|
});
|
|
265
265
|
|
|
266
266
|
// Calculate temp
|
|
267
|
-
|
|
267
|
+
const device = deviceData.Device;
|
|
268
|
+
this.emit('warn', JSON.stringify(device, null, 2));
|
|
268
269
|
switch (displayMode) {
|
|
269
270
|
case 1: //Heather/Cooler
|
|
270
|
-
switch (
|
|
271
|
+
switch (device.OperationMode) {
|
|
271
272
|
case 1: //HEAT
|
|
272
273
|
case 9: //ISEE HEAT
|
|
273
|
-
|
|
274
|
+
device.SetTemperature = device.DefaultHeatingSetTemperature;
|
|
274
275
|
break;
|
|
275
276
|
case 2: //DRY
|
|
276
277
|
case 3: //COOL
|
|
277
278
|
case 10: //ISEE DRY
|
|
278
279
|
case 11: //ISEE COOL
|
|
279
|
-
|
|
280
|
+
device.SetTemperature = device.DefaultCoolingSetTemperature;
|
|
280
281
|
break;
|
|
281
282
|
case 7: //FAN
|
|
282
|
-
|
|
283
|
+
device.SetTemperature = device.SetTemperature;
|
|
283
284
|
break;
|
|
284
285
|
case 8: //AUTO
|
|
285
|
-
|
|
286
|
-
this.defaultCoolingSetTemperature =
|
|
287
|
-
this.defaultHeatingSetTemperature =
|
|
286
|
+
device.SetTemperature = (device.DefaultCoolingSetTemperature + device.DefaultHeatingSetTemperature) / 2;
|
|
287
|
+
this.defaultCoolingSetTemperature = device.DefaultCoolingSetTemperature;
|
|
288
|
+
this.defaultHeatingSetTemperature = device.DefaultHeatingSetTemperature;
|
|
288
289
|
break;
|
|
289
290
|
default:
|
|
290
|
-
if (this.logWarn) this.emit('warn', `Unknown operation mode: ${
|
|
291
|
+
if (this.logWarn) this.emit('warn', `Unknown operation mode: ${device.OperationMode}`);
|
|
291
292
|
break;
|
|
292
293
|
};
|
|
293
294
|
case 2: //Thermostat
|
|
294
|
-
|
|
295
|
+
device.SetTemperature = device.SetTemperature;
|
|
295
296
|
break;
|
|
296
297
|
default:
|
|
297
298
|
if (this.logWarn) this.emit('warn', `Unknown display mode: ${displayMode}`);
|
|
@@ -299,19 +300,19 @@ class MelCloudAta extends EventEmitter {
|
|
|
299
300
|
};
|
|
300
301
|
|
|
301
302
|
// Convert values to strings
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
303
|
+
device.SetFanSpeed = String(device.SetFanSpeed);
|
|
304
|
+
device.OperationMode = AirConditioner.OperationModeMapEnumToString[device.OperationMode];
|
|
305
|
+
device.VaneHorizontalDirection = AirConditioner.VaneHorizontalDirectionMapEnumToString[device.VaneHorizontalDirection];
|
|
306
|
+
device.VaneVerticalDirection = AirConditioner.VaneVerticalDirectionMapEnumToString[device.VaneVerticalDirection];
|
|
306
307
|
|
|
307
308
|
const settings = {
|
|
308
309
|
data: {
|
|
309
|
-
Power:
|
|
310
|
-
SetTemperature:
|
|
311
|
-
SetFanSpeed:
|
|
312
|
-
OperationMode:
|
|
313
|
-
VaneHorizontalDirection:
|
|
314
|
-
VaneVerticalDirection:
|
|
310
|
+
Power: device.Power,
|
|
311
|
+
SetTemperature: device.SetTemperature,
|
|
312
|
+
SetFanSpeed: device.SetFanSpeed,
|
|
313
|
+
OperationMode: device.OperationMode,
|
|
314
|
+
VaneHorizontalDirection: device.VaneHorizontalDirection,
|
|
315
|
+
VaneVerticalDirection: device.VaneVerticalDirection
|
|
315
316
|
}
|
|
316
317
|
};
|
|
317
318
|
|