homebridge-melcloud-control 4.0.0-beta.184 → 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,33 +264,35 @@ class MelCloudAta extends EventEmitter {
|
|
|
264
264
|
});
|
|
265
265
|
|
|
266
266
|
// Calculate temp
|
|
267
|
+
const device = deviceData.Device;
|
|
268
|
+
this.emit('warn', JSON.stringify(device, null, 2));
|
|
267
269
|
switch (displayMode) {
|
|
268
270
|
case 1: //Heather/Cooler
|
|
269
|
-
switch (
|
|
271
|
+
switch (device.OperationMode) {
|
|
270
272
|
case 1: //HEAT
|
|
271
273
|
case 9: //ISEE HEAT
|
|
272
|
-
|
|
274
|
+
device.SetTemperature = device.DefaultHeatingSetTemperature;
|
|
273
275
|
break;
|
|
274
276
|
case 2: //DRY
|
|
275
277
|
case 3: //COOL
|
|
276
278
|
case 10: //ISEE DRY
|
|
277
279
|
case 11: //ISEE COOL
|
|
278
|
-
|
|
280
|
+
device.SetTemperature = device.DefaultCoolingSetTemperature;
|
|
279
281
|
break;
|
|
280
282
|
case 7: //FAN
|
|
281
|
-
|
|
283
|
+
device.SetTemperature = device.SetTemperature;
|
|
282
284
|
break;
|
|
283
285
|
case 8: //AUTO
|
|
284
|
-
|
|
285
|
-
this.defaultCoolingSetTemperature =
|
|
286
|
-
this.defaultHeatingSetTemperature =
|
|
286
|
+
device.SetTemperature = (device.DefaultCoolingSetTemperature + device.DefaultHeatingSetTemperature) / 2;
|
|
287
|
+
this.defaultCoolingSetTemperature = device.DefaultCoolingSetTemperature;
|
|
288
|
+
this.defaultHeatingSetTemperature = device.DefaultHeatingSetTemperature;
|
|
287
289
|
break;
|
|
288
290
|
default:
|
|
289
|
-
if (this.logWarn) this.emit('warn', `Unknown operation mode: ${
|
|
291
|
+
if (this.logWarn) this.emit('warn', `Unknown operation mode: ${device.OperationMode}`);
|
|
290
292
|
break;
|
|
291
293
|
};
|
|
292
294
|
case 2: //Thermostat
|
|
293
|
-
|
|
295
|
+
device.SetTemperature = device.SetTemperature;
|
|
294
296
|
break;
|
|
295
297
|
default:
|
|
296
298
|
if (this.logWarn) this.emit('warn', `Unknown display mode: ${displayMode}`);
|
|
@@ -298,23 +300,22 @@ class MelCloudAta extends EventEmitter {
|
|
|
298
300
|
};
|
|
299
301
|
|
|
300
302
|
// Convert values to strings
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
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];
|
|
305
307
|
|
|
306
308
|
const settings = {
|
|
307
309
|
data: {
|
|
308
|
-
Power:
|
|
309
|
-
SetTemperature:
|
|
310
|
-
SetFanSpeed:
|
|
311
|
-
OperationMode:
|
|
312
|
-
VaneHorizontalDirection:
|
|
313
|
-
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
|
|
314
316
|
}
|
|
315
317
|
};
|
|
316
318
|
|
|
317
|
-
this.emit('warn', JSON.stringify(deviceData, null, 2));
|
|
318
319
|
this.emit('warn', JSON.stringify(settings, null, 2));
|
|
319
320
|
|
|
320
321
|
const path = ApiUrlsHome.SetAta.replace('deviceid', deviceData.DeviceID);
|