homebridge-melcloud-control 4.1.3-beta.1 → 4.1.3-beta.2
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 +26 -12
- package/src/melcloudatw.js +34 -20
- package/src/melclouderv.js +25 -11
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"displayName": "MELCloud Control",
|
|
3
3
|
"name": "homebridge-melcloud-control",
|
|
4
|
-
"version": "4.1.3-beta.
|
|
4
|
+
"version": "4.1.3-beta.2",
|
|
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
|
@@ -203,19 +203,33 @@ class MelCloudAta extends EventEmitter {
|
|
|
203
203
|
}
|
|
204
204
|
}
|
|
205
205
|
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
206
|
+
let settings = {};
|
|
207
|
+
let path = '';
|
|
208
|
+
switch (effectiveFlags) {
|
|
209
|
+
case 'scheduleenabled':
|
|
210
|
+
settings = {
|
|
211
|
+
data: {
|
|
212
|
+
enabled: deviceData.ScheduleEnabled
|
|
213
|
+
}
|
|
214
|
+
};
|
|
215
|
+
path = ApiUrlsHome.PutScheduleEnable.replace('deviceid', deviceData.DeviceID);
|
|
216
|
+
break;
|
|
217
|
+
default:
|
|
218
|
+
settings = {
|
|
219
|
+
data: {
|
|
220
|
+
Power: deviceData.Device.Power,
|
|
221
|
+
SetTemperature: deviceData.Device.SetTemperature,
|
|
222
|
+
SetFanSpeed: String(deviceData.Device.SetFanSpeed),
|
|
223
|
+
OperationMode: AirConditioner.OperationModeMapEnumToString[deviceData.Device.OperationMode],
|
|
224
|
+
VaneHorizontalDirection: AirConditioner.VaneHorizontalDirectionMapEnumToString[deviceData.Device.VaneHorizontalDirection],
|
|
225
|
+
VaneVerticalDirection: AirConditioner.VaneVerticalDirectionMapEnumToString[deviceData.Device.VaneVerticalDirection],
|
|
226
|
+
}
|
|
227
|
+
};
|
|
228
|
+
path = ApiUrlsHome.SetAta.replace('deviceid', deviceData.DeviceID);
|
|
229
|
+
break
|
|
230
|
+
}
|
|
217
231
|
|
|
218
|
-
|
|
232
|
+
if (this.logDebug) this.emit('debug', `Send Data: ${JSON.stringify(settings.data, null, 2)}`);
|
|
219
233
|
await axiosInstancePut(path, settings);
|
|
220
234
|
this.updateData(deviceData);
|
|
221
235
|
return true;
|
package/src/melcloudatw.js
CHANGED
|
@@ -195,26 +195,40 @@ class MelCloudAtw extends EventEmitter {
|
|
|
195
195
|
withCredentials: true
|
|
196
196
|
});
|
|
197
197
|
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
198
|
+
let settings = {};
|
|
199
|
+
let path = '';
|
|
200
|
+
switch (effectiveFlags) {
|
|
201
|
+
case 'scheduleenabled':
|
|
202
|
+
settings = {
|
|
203
|
+
data: {
|
|
204
|
+
enabled: deviceData.ScheduleEnabled
|
|
205
|
+
}
|
|
206
|
+
};
|
|
207
|
+
path = ApiUrlsHome.PutScheduleEnable.replace('deviceid', deviceData.DeviceID);
|
|
208
|
+
break;
|
|
209
|
+
default:
|
|
210
|
+
settings = {
|
|
211
|
+
data: {
|
|
212
|
+
Power: deviceData.Device.Power,
|
|
213
|
+
SetTemperatureZone1: deviceData.Device.SetTemperatureZone1,
|
|
214
|
+
SetTemperatureZone2: deviceData.Device.SetTemperatureZone2,
|
|
215
|
+
OperationMode: HeatPump.OperationModeMapEnumToString[deviceData.Device.OperationMode],
|
|
216
|
+
OperationModeZone1: HeatPump.OperationModeMapEnumToString[deviceData.Device.OperationModeZone1],
|
|
217
|
+
OperationModeZone2: HeatPump.OperationModeMapEnumToString[deviceData.Device.OperationModeZone2],
|
|
218
|
+
SetHeatFlowTemperatureZone1: deviceData.Device.SetHeatFlowTemperatureZone1,
|
|
219
|
+
SetHeatFlowTemperatureZone2: deviceData.Device.SetHeatFlowTemperatureZone2,
|
|
220
|
+
SetCoolFlowTemperatureZone1: deviceData.Device.SetCoolFlowTemperatureZone1,
|
|
221
|
+
SetCoolFlowTemperatureZone2: deviceData.Device.SetCoolFlowTemperatureZone2,
|
|
222
|
+
SetTankWaterTemperature: deviceData.Device.SetTankWaterTemperature,
|
|
223
|
+
ForcedHotWaterMode: deviceData.Device.ForcedHotWaterMode,
|
|
224
|
+
EcoHotWater: deviceData.Device.EcoHotWater,
|
|
225
|
+
}
|
|
226
|
+
};
|
|
227
|
+
path = ApiUrlsHome.SetAtw.replace('deviceid', deviceData.DeviceID);
|
|
228
|
+
break
|
|
229
|
+
}
|
|
216
230
|
|
|
217
|
-
|
|
231
|
+
if (this.logDebug) this.emit('debug', `Send Data: ${JSON.stringify(settings.data, null, 2)}`);
|
|
218
232
|
await axiosInstancePut(path, settings);
|
|
219
233
|
this.updateData(deviceData);
|
|
220
234
|
return true;
|
|
@@ -226,7 +240,7 @@ class MelCloudAtw extends EventEmitter {
|
|
|
226
240
|
if (error?.response?.status === 500) {
|
|
227
241
|
return true;
|
|
228
242
|
}
|
|
229
|
-
|
|
243
|
+
|
|
230
244
|
throw new Error(`Send data error: ${error.message}`);
|
|
231
245
|
}
|
|
232
246
|
}
|
package/src/melclouderv.js
CHANGED
|
@@ -211,18 +211,32 @@ class MelCloudErv extends EventEmitter {
|
|
|
211
211
|
}
|
|
212
212
|
}
|
|
213
213
|
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
214
|
+
let settings = {};
|
|
215
|
+
let path = '';
|
|
216
|
+
switch (effectiveFlags) {
|
|
217
|
+
case 'scheduleenabled':
|
|
218
|
+
settings = {
|
|
219
|
+
data: {
|
|
220
|
+
enabled: deviceData.ScheduleEnabled
|
|
221
|
+
}
|
|
222
|
+
};
|
|
223
|
+
path = ApiUrlsHome.PutScheduleEnable.replace('deviceid', deviceData.DeviceID);
|
|
224
|
+
break;
|
|
225
|
+
default:
|
|
226
|
+
settings = {
|
|
227
|
+
data: {
|
|
228
|
+
Power: deviceData.Device.Power,
|
|
229
|
+
SetTemperature: deviceData.Device.SetTemperature,
|
|
230
|
+
SetFanSpeed: String(deviceData.Device.SetFanSpeed),
|
|
231
|
+
OperationMode: Ventilation.OperationModeMapEnumToString[deviceData.Device.OperationMode],
|
|
232
|
+
VentilationMode: Ventilation.VentilationModeMapEnumToString[deviceData.Device.VentilationMode],
|
|
233
|
+
}
|
|
234
|
+
};
|
|
235
|
+
path = ApiUrlsHome.SetErv.replace('deviceid', deviceData.DeviceID);
|
|
236
|
+
break
|
|
237
|
+
}
|
|
224
238
|
|
|
225
|
-
|
|
239
|
+
if (this.logDebug) this.emit('debug', `Send Data: ${JSON.stringify(settings.data, null, 2)}`);
|
|
226
240
|
await axiosInstancePut(path, settings);
|
|
227
241
|
this.updateData(deviceData);
|
|
228
242
|
return true;
|