homebridge-melcloud-control 4.1.2-beta.90 → 4.1.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/CHANGELOG.md +1 -1
- package/package.json +1 -1
- package/src/deviceatw.js +1 -1
- package/src/deviceerv.js +1 -1
- package/src/melcloudata.js +6 -1
- package/src/melcloudatw.js +7 -2
- package/src/melclouderv.js +7 -2
package/CHANGELOG.md
CHANGED
|
@@ -27,7 +27,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
27
27
|
## Changes
|
|
28
28
|
|
|
29
29
|
- fix [#218](https://github.com/grzegorz914/homebridge-melcloud-control/issues/218)
|
|
30
|
-
- added
|
|
30
|
+
- added schedules support for MELCLoud Home ATA devices
|
|
31
31
|
- config schema updated
|
|
32
32
|
- readme updated
|
|
33
33
|
- cleanup
|
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.2
|
|
4
|
+
"version": "4.1.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/deviceatw.js
CHANGED
|
@@ -1156,7 +1156,7 @@ class DeviceAtw extends EventEmitter {
|
|
|
1156
1156
|
.onSet(async (state) => {
|
|
1157
1157
|
try {
|
|
1158
1158
|
deviceData.ScheduleEnabled = state;
|
|
1159
|
-
await this.melCloudAta.send(this.accountType, this.displayType, deviceData);
|
|
1159
|
+
await this.melCloudAta.send(this.accountType, this.displayType, deviceData, 'scheduleset');
|
|
1160
1160
|
if (this.logInfo) this.emit('info', `${state ? 'Set:' : 'Unset:'} ${name}`);
|
|
1161
1161
|
} catch (error) {
|
|
1162
1162
|
if (this.logWarn) this.emit('warn', `Set schedule error: ${error}`);
|
package/src/deviceerv.js
CHANGED
|
@@ -760,7 +760,7 @@ class DeviceErv extends EventEmitter {
|
|
|
760
760
|
.onSet(async (state) => {
|
|
761
761
|
try {
|
|
762
762
|
deviceData.ScheduleEnabled = state;
|
|
763
|
-
await this.melCloudAta.send(this.accountType, this.displayType, deviceData);
|
|
763
|
+
await this.melCloudAta.send(this.accountType, this.displayType, deviceData, 'scheduleset');
|
|
764
764
|
if (this.logInfo) this.emit('info', `${state ? 'Set:' : 'Unset:'} ${name}`);
|
|
765
765
|
} catch (error) {
|
|
766
766
|
if (this.logWarn) this.emit('warn', `Set schedule error: ${error}`);
|
package/src/melcloudata.js
CHANGED
|
@@ -213,7 +213,7 @@ class MelCloudAta extends EventEmitter {
|
|
|
213
213
|
VaneVerticalDirection: AirConditioner.VaneVerticalDirectionMapEnumToString[deviceData.Device.VaneVerticalDirection],
|
|
214
214
|
}
|
|
215
215
|
};
|
|
216
|
-
if (
|
|
216
|
+
if (this.logDebug) this.emit('debug', `Send Data: ${JSON.stringify(settings.data, null, 2)}`);
|
|
217
217
|
|
|
218
218
|
const path = effectiveFlags === 'scheduleset' ? ApiUrlsHome.SetSchedule.replace('deviceid', deviceData.DeviceID) : ApiUrlsHome.SetAta.replace('deviceid', deviceData.DeviceID);
|
|
219
219
|
await axiosInstancePut(path, settings);
|
|
@@ -223,6 +223,11 @@ class MelCloudAta extends EventEmitter {
|
|
|
223
223
|
return;
|
|
224
224
|
}
|
|
225
225
|
} catch (error) {
|
|
226
|
+
// Return 500 for schedule hovewer working correct
|
|
227
|
+
if (error?.response?.status === 500) {
|
|
228
|
+
return true;
|
|
229
|
+
}
|
|
230
|
+
|
|
226
231
|
throw new Error(`Send data error: ${error.message}`);
|
|
227
232
|
}
|
|
228
233
|
}
|
package/src/melcloudatw.js
CHANGED
|
@@ -195,7 +195,7 @@ class MelCloudAtw extends EventEmitter {
|
|
|
195
195
|
withCredentials: true
|
|
196
196
|
});
|
|
197
197
|
|
|
198
|
-
const settings = {
|
|
198
|
+
const settings = effectiveFlags === 'scheduleset' ? { data: { enabled: deviceData.ScheduleEnabled } } : {
|
|
199
199
|
data: {
|
|
200
200
|
Power: deviceData.Device.Power,
|
|
201
201
|
SetTemperatureZone1: deviceData.Device.SetTemperatureZone1,
|
|
@@ -214,7 +214,7 @@ class MelCloudAtw extends EventEmitter {
|
|
|
214
214
|
};
|
|
215
215
|
if (this.logDebug) this.emit('debug', `Send Data: ${JSON.stringify(settings.data, null, 2)}`);
|
|
216
216
|
|
|
217
|
-
const path = ApiUrlsHome.SetAtw.replace('deviceid', deviceData.DeviceID);
|
|
217
|
+
const path = effectiveFlags === 'scheduleset' ? ApiUrlsHome.SetSchedule.replace('deviceid', deviceData.DeviceID) : ApiUrlsHome.SetAtw.replace('deviceid', deviceData.DeviceID);
|
|
218
218
|
await axiosInstancePut(path, settings);
|
|
219
219
|
this.updateData(deviceData);
|
|
220
220
|
return true;
|
|
@@ -222,6 +222,11 @@ class MelCloudAtw extends EventEmitter {
|
|
|
222
222
|
return;
|
|
223
223
|
}
|
|
224
224
|
} catch (error) {
|
|
225
|
+
// Return 500 for schedule hovewer working correct
|
|
226
|
+
if (error?.response?.status === 500) {
|
|
227
|
+
return true;
|
|
228
|
+
}
|
|
229
|
+
|
|
225
230
|
throw new Error(`Send data error: ${error.message}`);
|
|
226
231
|
}
|
|
227
232
|
}
|
package/src/melclouderv.js
CHANGED
|
@@ -211,7 +211,7 @@ class MelCloudErv extends EventEmitter {
|
|
|
211
211
|
}
|
|
212
212
|
}
|
|
213
213
|
|
|
214
|
-
const settings = {
|
|
214
|
+
const settings = effectiveFlags === 'scheduleset' ? { data: { enabled: deviceData.ScheduleEnabled } } : {
|
|
215
215
|
data: {
|
|
216
216
|
Power: deviceData.Device.Power,
|
|
217
217
|
SetTemperature: deviceData.Device.SetTemperature,
|
|
@@ -222,7 +222,7 @@ class MelCloudErv extends EventEmitter {
|
|
|
222
222
|
};
|
|
223
223
|
if (this.logDebug) this.emit('debug', `Send Data: ${JSON.stringify(settings.data, null, 2)}`);
|
|
224
224
|
|
|
225
|
-
const path = ApiUrlsHome.SetErv.replace('deviceid', deviceData.DeviceID);
|
|
225
|
+
const path = effectiveFlags === 'scheduleset' ? ApiUrlsHome.SetSchedule.replace('deviceid', deviceData.DeviceID) : ApiUrlsHome.SetErv.replace('deviceid', deviceData.DeviceID);
|
|
226
226
|
await axiosInstancePut(path, settings);
|
|
227
227
|
this.updateData(deviceData);
|
|
228
228
|
return true;
|
|
@@ -230,6 +230,11 @@ class MelCloudErv extends EventEmitter {
|
|
|
230
230
|
return;
|
|
231
231
|
}
|
|
232
232
|
} catch (error) {
|
|
233
|
+
// Return 500 for schedule hovewer working correct
|
|
234
|
+
if (error?.response?.status === 500) {
|
|
235
|
+
return true;
|
|
236
|
+
}
|
|
237
|
+
|
|
233
238
|
throw new Error(`Send data error: ${error.message}`);
|
|
234
239
|
}
|
|
235
240
|
}
|