homebridge-melcloud-control 4.0.0-beta.186 → 4.0.0-beta.188
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/melcloudata.js +21 -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.188",
|
|
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/melcloudata.js
CHANGED
|
@@ -166,6 +166,7 @@ class MelCloudAta extends EventEmitter {
|
|
|
166
166
|
|
|
167
167
|
//emit state
|
|
168
168
|
this.emit('deviceState', deviceData);
|
|
169
|
+
await new Promise(resolve => setTimeout(resolve, 1000));
|
|
169
170
|
|
|
170
171
|
return true;
|
|
171
172
|
} catch (error) {
|
|
@@ -264,35 +265,34 @@ class MelCloudAta extends EventEmitter {
|
|
|
264
265
|
});
|
|
265
266
|
|
|
266
267
|
// Calculate temp
|
|
267
|
-
|
|
268
|
-
this.emit('warn', JSON.stringify(device, null, 2));
|
|
268
|
+
this.emit('warn', JSON.stringify(deviceData, null, 2));
|
|
269
269
|
switch (displayMode) {
|
|
270
270
|
case 1: //Heather/Cooler
|
|
271
|
-
switch (
|
|
271
|
+
switch (deviceData.Device.OperationMode) {
|
|
272
272
|
case 1: //HEAT
|
|
273
273
|
case 9: //ISEE HEAT
|
|
274
|
-
|
|
274
|
+
deviceData.Device.SetTemperature = deviceData.Device.DefaultHeatingSetTemperature;
|
|
275
275
|
break;
|
|
276
276
|
case 2: //DRY
|
|
277
277
|
case 3: //COOL
|
|
278
278
|
case 10: //ISEE DRY
|
|
279
279
|
case 11: //ISEE COOL
|
|
280
|
-
|
|
280
|
+
deviceData.Device.SetTemperature = deviceData.Device.DefaultCoolingSetTemperature;
|
|
281
281
|
break;
|
|
282
282
|
case 7: //FAN
|
|
283
|
-
|
|
283
|
+
deviceData.Device.SetTemperature = deviceData.Device.SetTemperature;
|
|
284
284
|
break;
|
|
285
285
|
case 8: //AUTO
|
|
286
|
-
|
|
287
|
-
this.defaultCoolingSetTemperature =
|
|
288
|
-
this.defaultHeatingSetTemperature =
|
|
286
|
+
deviceData.Device.SetTemperature = (deviceData.Device.DefaultCoolingSetTemperature + deviceData.Device.DefaultHeatingSetTemperature) / 2;
|
|
287
|
+
this.defaultCoolingSetTemperature = deviceData.Device.DefaultCoolingSetTemperature;
|
|
288
|
+
this.defaultHeatingSetTemperature = deviceData.Device.DefaultHeatingSetTemperature;
|
|
289
289
|
break;
|
|
290
290
|
default:
|
|
291
|
-
if (this.logWarn) this.emit('warn', `Unknown operation mode: ${
|
|
291
|
+
if (this.logWarn) this.emit('warn', `Unknown operation mode: ${deviceData.Device.OperationMode}`);
|
|
292
292
|
break;
|
|
293
293
|
};
|
|
294
294
|
case 2: //Thermostat
|
|
295
|
-
|
|
295
|
+
deviceData.Device.SetTemperature = deviceData.Device.SetTemperature;
|
|
296
296
|
break;
|
|
297
297
|
default:
|
|
298
298
|
if (this.logWarn) this.emit('warn', `Unknown display mode: ${displayMode}`);
|
|
@@ -300,19 +300,19 @@ class MelCloudAta extends EventEmitter {
|
|
|
300
300
|
};
|
|
301
301
|
|
|
302
302
|
// Convert values to strings
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
303
|
+
deviceData.Device.SetFanSpeed = String(deviceData.Device.SetFanSpeed);
|
|
304
|
+
deviceData.Device.OperationMode = AirConditioner.OperationModeMapEnumToString[deviceData.Device.OperationMode];
|
|
305
|
+
deviceData.Device.VaneHorizontalDirection = AirConditioner.VaneHorizontalDirectionMapEnumToString[deviceData.Device.VaneHorizontalDirection];
|
|
306
|
+
deviceData.Device.VaneVerticalDirection = AirConditioner.VaneVerticalDirectionMapEnumToString[deviceData.Device.VaneVerticalDirection];
|
|
307
307
|
|
|
308
308
|
const settings = {
|
|
309
309
|
data: {
|
|
310
|
-
Power:
|
|
311
|
-
SetTemperature:
|
|
312
|
-
SetFanSpeed:
|
|
313
|
-
OperationMode:
|
|
314
|
-
VaneHorizontalDirection:
|
|
315
|
-
VaneVerticalDirection:
|
|
310
|
+
Power: deviceData.Device.Power,
|
|
311
|
+
SetTemperature: deviceData.Device.SetTemperature,
|
|
312
|
+
SetFanSpeed: deviceData.Device.SetFanSpeed,
|
|
313
|
+
OperationMode: deviceData.Device.OperationMode,
|
|
314
|
+
VaneHorizontalDirection: deviceData.Device.VaneHorizontalDirection,
|
|
315
|
+
VaneVerticalDirection: deviceData.Device.VaneVerticalDirection
|
|
316
316
|
}
|
|
317
317
|
};
|
|
318
318
|
|