homebridge-melcloud-control 4.2.5-beta.19 → 4.2.5-beta.20
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 +7 -7
- package/src/deviceatw.js +5 -5
- package/src/deviceerv.js +5 -5
- package/src/melcloudhome.js +0 -8
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"displayName": "MELCloud Control",
|
|
3
3
|
"name": "homebridge-melcloud-control",
|
|
4
|
-
"version": "4.2.5-beta.
|
|
4
|
+
"version": "4.2.5-beta.20",
|
|
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
|
@@ -725,7 +725,7 @@ class DeviceAta extends EventEmitter {
|
|
|
725
725
|
.onSet(async (state) => {
|
|
726
726
|
try {
|
|
727
727
|
deviceData.FrostProtection.Enabled = state;
|
|
728
|
-
if (this.logInfo) this.emit('info', `Frost protection: ${state ? '
|
|
728
|
+
if (this.logInfo) this.emit('info', `Frost protection: ${state ? 'Enabled' : 'Disabled'}`);
|
|
729
729
|
await this.melCloudAta.send(this.accountType, this.displayType, deviceData, 'frostprotection');
|
|
730
730
|
} catch (error) {
|
|
731
731
|
if (this.logWarn) this.emit('warn', `Set frost protection error: ${error}`);
|
|
@@ -772,7 +772,7 @@ class DeviceAta extends EventEmitter {
|
|
|
772
772
|
.onSet(async (state) => {
|
|
773
773
|
try {
|
|
774
774
|
deviceData.OverheatProtection.Enabled = state;
|
|
775
|
-
if (this.logInfo) this.emit('info', `Overheat protection: ${state ? '
|
|
775
|
+
if (this.logInfo) this.emit('info', `Overheat protection: ${state ? 'Enabled' : 'Disabled'}`);
|
|
776
776
|
await this.melCloudAta.send(this.accountType, this.displayType, deviceData, 'overheatprotection');
|
|
777
777
|
} catch (error) {
|
|
778
778
|
if (this.logWarn) this.emit('warn', `Set overheat protection error: ${error}`);
|
|
@@ -818,7 +818,7 @@ class DeviceAta extends EventEmitter {
|
|
|
818
818
|
.onSet(async (state) => {
|
|
819
819
|
try {
|
|
820
820
|
deviceData.HolidayMode.Enabled = state;
|
|
821
|
-
if (this.logInfo) this.emit('info', `Holiday mode: ${state ? '
|
|
821
|
+
if (this.logInfo) this.emit('info', `Holiday mode: ${state ? 'Enabled' : 'Disabled'}`);
|
|
822
822
|
await this.melCloudAta.send(this.accountType, this.displayType, deviceData, 'holidaymode');
|
|
823
823
|
} catch (error) {
|
|
824
824
|
if (this.logWarn) this.emit('warn', `Set holiday mode error: ${error}`);
|
|
@@ -900,7 +900,7 @@ class DeviceAta extends EventEmitter {
|
|
|
900
900
|
break;
|
|
901
901
|
};
|
|
902
902
|
|
|
903
|
-
if (this.logInfo) this.emit('info', `Preset ${name}: ${state ? 'Set
|
|
903
|
+
if (this.logInfo) this.emit('info', `Preset: ${name}: ${state ? 'Set' : 'Unset'}`);
|
|
904
904
|
await this.melCloudAta.send(this.accountType, this.displayType, deviceData, AirConditioner.EffectiveFlags.Presets);
|
|
905
905
|
} catch (error) {
|
|
906
906
|
if (this.logWarn) this.emit('warn', `Set preset error: ${error}`);
|
|
@@ -957,7 +957,7 @@ class DeviceAta extends EventEmitter {
|
|
|
957
957
|
.onSet(async (state) => {
|
|
958
958
|
try {
|
|
959
959
|
deviceData.ScheduleEnabled = state;
|
|
960
|
-
if (this.logInfo) this.emit('info', `Schedules: ${state ? '
|
|
960
|
+
if (this.logInfo) this.emit('info', `Schedules: ${state ? 'Enabled' : 'Disabled'}`);
|
|
961
961
|
await this.melCloudAta.send(this.accountType, this.displayType, deviceData, 'schedule');
|
|
962
962
|
} catch (error) {
|
|
963
963
|
if (this.logWarn) this.emit('warn', `Set schedules error: ${error}`);
|
|
@@ -1026,7 +1026,7 @@ class DeviceAta extends EventEmitter {
|
|
|
1026
1026
|
.onSet(async (state) => {
|
|
1027
1027
|
try {
|
|
1028
1028
|
sceneData.Enabled = state;
|
|
1029
|
-
if (this.logInfo) this.emit('info', `Scene ${name}: ${state ? '
|
|
1029
|
+
if (this.logInfo) this.emit('info', `Scene ${name}: ${state ? 'Set' : 'Unset'}`);
|
|
1030
1030
|
await this.melCloudAta.send(this.accountType, this.displayType, deviceData, 'scene', sceneData);
|
|
1031
1031
|
} catch (error) {
|
|
1032
1032
|
if (this.logWarn) this.emit('warn', `Set scene error: ${error}`);
|
|
@@ -1287,7 +1287,7 @@ class DeviceAta extends EventEmitter {
|
|
|
1287
1287
|
break;
|
|
1288
1288
|
};
|
|
1289
1289
|
|
|
1290
|
-
if (this.logInfo) this.emit('info',
|
|
1290
|
+
if (this.logInfo) this.emit('info', `Button ${name}: ${state ? `Enabled` : `Disabled`}`);
|
|
1291
1291
|
await this.melCloudAta.send(this.accountType, this.displayType, deviceData, flag);
|
|
1292
1292
|
} catch (error) {
|
|
1293
1293
|
if (this.logWarn) this.emit('warn', `Set button error: ${error}`);
|
package/src/deviceatw.js
CHANGED
|
@@ -1137,7 +1137,7 @@ class DeviceAtw extends EventEmitter {
|
|
|
1137
1137
|
.onSet(async (state) => {
|
|
1138
1138
|
try {
|
|
1139
1139
|
deviceData.HolidayMode.Enabled = state;
|
|
1140
|
-
if (this.logInfo) this.emit('info', `Holiday mode: ${state ? '
|
|
1140
|
+
if (this.logInfo) this.emit('info', `Holiday mode: ${state ? 'Enabled' : 'Disabled'}`);
|
|
1141
1141
|
await this.melCloudAtw.send(this.accountType, this.displayType, deviceData, 'holidaymode');
|
|
1142
1142
|
} catch (error) {
|
|
1143
1143
|
if (this.logWarn) this.emit('warn', `Set holiday mode error: ${error}`);
|
|
@@ -1219,7 +1219,7 @@ class DeviceAtw extends EventEmitter {
|
|
|
1219
1219
|
break;
|
|
1220
1220
|
};
|
|
1221
1221
|
|
|
1222
|
-
if (this.logInfo) this.emit('info', `Preset ${name}: ${state ? 'Set
|
|
1222
|
+
if (this.logInfo) this.emit('info', `Preset ${name}: ${state ? 'Set' : 'Unset'}`);
|
|
1223
1223
|
await this.melCloudAtw.send(this.accountType, this.displayType, deviceData, AirConditioner.EffectiveFlags.Presets);
|
|
1224
1224
|
} catch (error) {
|
|
1225
1225
|
if (this.logWarn) this.emit('warn', `Set preset error: ${error}`);
|
|
@@ -1276,7 +1276,7 @@ class DeviceAtw extends EventEmitter {
|
|
|
1276
1276
|
.onSet(async (state) => {
|
|
1277
1277
|
try {
|
|
1278
1278
|
deviceData.ScheduleEnabled = state;
|
|
1279
|
-
if (this.logInfo) this.emit('info', `Schedules: ${state ? '
|
|
1279
|
+
if (this.logInfo) this.emit('info', `Schedules: ${state ? 'Enabled' : 'Disabled'}`);
|
|
1280
1280
|
await this.melCloudAtw.send(this.accountType, this.displayType, deviceData, 'schedule');
|
|
1281
1281
|
} catch (error) {
|
|
1282
1282
|
if (this.logWarn) this.emit('warn', `Set schedules error: ${error}`);
|
|
@@ -1345,7 +1345,7 @@ class DeviceAtw extends EventEmitter {
|
|
|
1345
1345
|
.onSet(async (state) => {
|
|
1346
1346
|
try {
|
|
1347
1347
|
sceneData.Enabled = state;
|
|
1348
|
-
if (this.logInfo) this.emit('info', `Scene ${name}: ${state ? '
|
|
1348
|
+
if (this.logInfo) this.emit('info', `Scene ${name}: ${state ? 'Set' : 'Unset'}`);
|
|
1349
1349
|
await this.melCloudAtw.send(this.accountType, this.displayType, deviceData, 'scene', sceneData);
|
|
1350
1350
|
} catch (error) {
|
|
1351
1351
|
if (this.logWarn) this.emit('warn', `Set scene error: ${error}`);
|
|
@@ -1536,7 +1536,7 @@ class DeviceAtw extends EventEmitter {
|
|
|
1536
1536
|
break;
|
|
1537
1537
|
};
|
|
1538
1538
|
|
|
1539
|
-
if (this.logInfo) this.emit('info',
|
|
1539
|
+
if (this.logInfo) this.emit('info', `Button ${name}: ${state ? `Enabled` : `Disabled`}`);
|
|
1540
1540
|
await this.melCloudAtw.send(this.accountType, this.displayType, deviceData, flag);
|
|
1541
1541
|
} catch (error) {
|
|
1542
1542
|
if (this.logWarn) this.emit('warn', `Set button error: ${error}`);
|
package/src/deviceerv.js
CHANGED
|
@@ -741,7 +741,7 @@ class DeviceErv extends EventEmitter {
|
|
|
741
741
|
.onSet(async (state) => {
|
|
742
742
|
try {
|
|
743
743
|
deviceData.HolidayMode.Enabled = state;
|
|
744
|
-
if (this.logInfo) this.emit('info', `Holiday mode: ${state ? '
|
|
744
|
+
if (this.logInfo) this.emit('info', `Holiday mode: ${state ? 'Enabled' : 'Disabled'}`);
|
|
745
745
|
await this.melCloudErv.send(this.accountType, this.displayType, deviceData, 'holidaymode');
|
|
746
746
|
} catch (error) {
|
|
747
747
|
if (this.logWarn) this.emit('warn', `Set holiday mode error: ${error}`);
|
|
@@ -823,7 +823,7 @@ class DeviceErv extends EventEmitter {
|
|
|
823
823
|
break;
|
|
824
824
|
};
|
|
825
825
|
|
|
826
|
-
if (this.logInfo) this.emit('info', `Preset ${name}: ${state ? 'Set
|
|
826
|
+
if (this.logInfo) this.emit('info', `Preset ${name}: ${state ? 'Set' : 'Unset'}`);
|
|
827
827
|
await this.melCloudErv.send(this.accountType, this.displayType, deviceData, AirConditioner.EffectiveFlags.Presets);
|
|
828
828
|
} catch (error) {
|
|
829
829
|
if (this.logWarn) this.emit('warn', `Set preset error: ${error}`);
|
|
@@ -880,7 +880,7 @@ class DeviceErv extends EventEmitter {
|
|
|
880
880
|
.onSet(async (state) => {
|
|
881
881
|
try {
|
|
882
882
|
deviceData.ScheduleEnabled = state;
|
|
883
|
-
if (this.logInfo) this.emit('info', `Schedules: ${state ? '
|
|
883
|
+
if (this.logInfo) this.emit('info', `Schedules: ${state ? 'Enabled' : 'Disabled'}`);
|
|
884
884
|
await this.melCloudErv.send(this.accountType, this.displayType, deviceData, 'schedule');
|
|
885
885
|
} catch (error) {
|
|
886
886
|
if (this.logWarn) this.emit('warn', `Set schedule serror: ${error}`);
|
|
@@ -949,7 +949,7 @@ class DeviceErv extends EventEmitter {
|
|
|
949
949
|
.onSet(async (state) => {
|
|
950
950
|
try {
|
|
951
951
|
sceneData.Enabled = state;
|
|
952
|
-
if (this.logInfo) this.emit('info', `Scene ${name}: ${state ? '
|
|
952
|
+
if (this.logInfo) this.emit('info', `Scene ${name}: ${state ? 'Set' : 'Unset'}`);
|
|
953
953
|
await this.melCloudErv.send(this.accountType, this.displayType, deviceData, 'scene', sceneData);
|
|
954
954
|
} catch (error) {
|
|
955
955
|
if (this.logWarn) this.emit('warn', `Set scene error: ${error}`);
|
|
@@ -1082,7 +1082,7 @@ class DeviceErv extends EventEmitter {
|
|
|
1082
1082
|
break;
|
|
1083
1083
|
};
|
|
1084
1084
|
|
|
1085
|
-
if (this.logInfo) this.emit('info',
|
|
1085
|
+
if (this.logInfo) this.emit('info', `Button ${name}: ${state ? `Enabled` : `Disabled`}`);
|
|
1086
1086
|
await this.melCloudErv.send(this.accountType, this.displayType, deviceData, flag);
|
|
1087
1087
|
} catch (error) {
|
|
1088
1088
|
if (this.logWarn) this.emit('warn', `Set button error: ${error}`);
|
package/src/melcloudhome.js
CHANGED
|
@@ -207,13 +207,6 @@ class MelCloud extends EventEmitter {
|
|
|
207
207
|
|
|
208
208
|
return devicesList;
|
|
209
209
|
} catch (error) {
|
|
210
|
-
if (error.response?.status === 401) {
|
|
211
|
-
if (this.logWarn) this.emit('warn', 'Check devices list not possible, cookies expired, trying to get new.');
|
|
212
|
-
this.locks.checkDevicesList = true;
|
|
213
|
-
await this.connect();
|
|
214
|
-
return;
|
|
215
|
-
}
|
|
216
|
-
|
|
217
210
|
throw new Error(`Check devices list error: ${error.message}`);
|
|
218
211
|
}
|
|
219
212
|
}
|
|
@@ -364,7 +357,6 @@ class MelCloud extends EventEmitter {
|
|
|
364
357
|
} catch (error) {
|
|
365
358
|
throw new Error(`Connect error: ${error.message}`);
|
|
366
359
|
} finally {
|
|
367
|
-
this.locks.checkDevicesList = false;
|
|
368
360
|
if (browser) {
|
|
369
361
|
try { await browser.close(); }
|
|
370
362
|
catch (closeErr) {
|