homebridge-melcloud-control 4.0.0-beta.186 → 4.0.0-beta.187
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 +1 -1
- package/src/melcloudata.js +20 -21
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.187",
|
|
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
|
@@ -240,7 +240,7 @@ class DeviceAta extends EventEmitter {
|
|
|
240
240
|
//prepare accessory
|
|
241
241
|
async prepareAccessory() {
|
|
242
242
|
try {
|
|
243
|
-
|
|
243
|
+
let deviceData = this.deviceData;
|
|
244
244
|
const deviceId = this.deviceId;
|
|
245
245
|
const deviceTypeText = this.deviceTypeText;
|
|
246
246
|
const deviceName = this.deviceName;
|
package/src/melcloudata.js
CHANGED
|
@@ -264,35 +264,34 @@ class MelCloudAta extends EventEmitter {
|
|
|
264
264
|
});
|
|
265
265
|
|
|
266
266
|
// Calculate temp
|
|
267
|
-
|
|
268
|
-
this.emit('warn', JSON.stringify(device, null, 2));
|
|
267
|
+
this.emit('warn', JSON.stringify(deviceData, null, 2));
|
|
269
268
|
switch (displayMode) {
|
|
270
269
|
case 1: //Heather/Cooler
|
|
271
|
-
switch (
|
|
270
|
+
switch (deviceData.Device.OperationMode) {
|
|
272
271
|
case 1: //HEAT
|
|
273
272
|
case 9: //ISEE HEAT
|
|
274
|
-
|
|
273
|
+
deviceData.Device.SetTemperature = deviceData.Device.DefaultHeatingSetTemperature;
|
|
275
274
|
break;
|
|
276
275
|
case 2: //DRY
|
|
277
276
|
case 3: //COOL
|
|
278
277
|
case 10: //ISEE DRY
|
|
279
278
|
case 11: //ISEE COOL
|
|
280
|
-
|
|
279
|
+
deviceData.Device.SetTemperature = deviceData.Device.DefaultCoolingSetTemperature;
|
|
281
280
|
break;
|
|
282
281
|
case 7: //FAN
|
|
283
|
-
|
|
282
|
+
deviceData.Device.SetTemperature = deviceData.Device.SetTemperature;
|
|
284
283
|
break;
|
|
285
284
|
case 8: //AUTO
|
|
286
|
-
|
|
287
|
-
this.defaultCoolingSetTemperature =
|
|
288
|
-
this.defaultHeatingSetTemperature =
|
|
285
|
+
deviceData.Device.SetTemperature = (deviceData.Device.DefaultCoolingSetTemperature + deviceData.Device.DefaultHeatingSetTemperature) / 2;
|
|
286
|
+
this.defaultCoolingSetTemperature = deviceData.Device.DefaultCoolingSetTemperature;
|
|
287
|
+
this.defaultHeatingSetTemperature = deviceData.Device.DefaultHeatingSetTemperature;
|
|
289
288
|
break;
|
|
290
289
|
default:
|
|
291
|
-
if (this.logWarn) this.emit('warn', `Unknown operation mode: ${
|
|
290
|
+
if (this.logWarn) this.emit('warn', `Unknown operation mode: ${deviceData.Device.OperationMode}`);
|
|
292
291
|
break;
|
|
293
292
|
};
|
|
294
293
|
case 2: //Thermostat
|
|
295
|
-
|
|
294
|
+
deviceData.Device.SetTemperature = deviceData.Device.SetTemperature;
|
|
296
295
|
break;
|
|
297
296
|
default:
|
|
298
297
|
if (this.logWarn) this.emit('warn', `Unknown display mode: ${displayMode}`);
|
|
@@ -300,19 +299,19 @@ class MelCloudAta extends EventEmitter {
|
|
|
300
299
|
};
|
|
301
300
|
|
|
302
301
|
// Convert values to strings
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
302
|
+
deviceData.Device.SetFanSpeed = String(deviceData.Device.SetFanSpeed);
|
|
303
|
+
deviceData.Device.OperationMode = AirConditioner.OperationModeMapEnumToString[deviceData.Device.OperationMode];
|
|
304
|
+
deviceData.Device.VaneHorizontalDirection = AirConditioner.VaneHorizontalDirectionMapEnumToString[deviceData.Device.VaneHorizontalDirection];
|
|
305
|
+
deviceData.Device.VaneVerticalDirection = AirConditioner.VaneVerticalDirectionMapEnumToString[deviceData.Device.VaneVerticalDirection];
|
|
307
306
|
|
|
308
307
|
const settings = {
|
|
309
308
|
data: {
|
|
310
|
-
Power:
|
|
311
|
-
SetTemperature:
|
|
312
|
-
SetFanSpeed:
|
|
313
|
-
OperationMode:
|
|
314
|
-
VaneHorizontalDirection:
|
|
315
|
-
VaneVerticalDirection:
|
|
309
|
+
Power: deviceData.Device.Power,
|
|
310
|
+
SetTemperature: deviceData.Device.SetTemperature,
|
|
311
|
+
SetFanSpeed: deviceData.Device.SetFanSpeed,
|
|
312
|
+
OperationMode: deviceData.Device.OperationMode,
|
|
313
|
+
VaneHorizontalDirection: deviceData.Device.VaneHorizontalDirection,
|
|
314
|
+
VaneVerticalDirection: deviceData.Device.VaneVerticalDirection
|
|
316
315
|
}
|
|
317
316
|
};
|
|
318
317
|
|