homebridge-melcloud-control 4.2.3-beta.53 → 4.2.3-beta.54
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 +60 -60
- package/src/deviceatw.js +103 -103
- package/src/deviceerv.js +34 -34
- package/src/melcloudata.js +4 -4
- package/src/melcloudatw.js +3 -3
- package/src/melclouderv.js +3 -3
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.3-beta.
|
|
4
|
+
"version": "4.2.3-beta.54",
|
|
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
|
@@ -180,101 +180,101 @@ class DeviceAta extends EventEmitter {
|
|
|
180
180
|
async setOverExternalIntegration(integration, deviceData, key, value) {
|
|
181
181
|
try {
|
|
182
182
|
let set = false
|
|
183
|
-
let
|
|
183
|
+
let flag = null;
|
|
184
184
|
switch (key) {
|
|
185
185
|
case 'Power':
|
|
186
186
|
deviceData.Device[key] = value;
|
|
187
|
-
|
|
187
|
+
flag = AirConditioner.EffectiveFlags.Power;
|
|
188
188
|
break;
|
|
189
189
|
case 'OperationMode':
|
|
190
190
|
deviceData.Device[key] = value;
|
|
191
|
-
|
|
191
|
+
flag = AirConditioner.EffectiveFlags.OperationMode
|
|
192
192
|
break;
|
|
193
193
|
case 'SetTemperature':
|
|
194
194
|
deviceData.Device[key] = value;
|
|
195
|
-
|
|
195
|
+
flag = AirConditioner.EffectiveFlags.SetTemperature;
|
|
196
196
|
break;
|
|
197
197
|
case 'DefaultCoolingSetTemperature':
|
|
198
198
|
deviceData.Device[key] = value;
|
|
199
|
-
|
|
199
|
+
flag = AirConditioner.EffectiveFlags.SetTemperature;
|
|
200
200
|
break;
|
|
201
201
|
case 'DefaultHeatingSetTemperature':
|
|
202
202
|
deviceData.Device[key] = value;
|
|
203
|
-
|
|
203
|
+
flag = AirConditioner.EffectiveFlags.SetTemperature;
|
|
204
204
|
break;
|
|
205
205
|
case 'FanSpeed':
|
|
206
206
|
key = this.accountType === 'melcloud' ? key : 'SetFanSpeed';
|
|
207
207
|
deviceData.Device[key] = value;
|
|
208
|
-
|
|
208
|
+
flag = AirConditioner.EffectiveFlags.SetFanSpeed;
|
|
209
209
|
break;
|
|
210
210
|
case 'VaneHorizontalDirection':
|
|
211
211
|
deviceData.Device[key] = value;
|
|
212
|
-
|
|
212
|
+
flag = AirConditioner.EffectiveFlags.VaneHorizontalDirection;
|
|
213
213
|
break;
|
|
214
214
|
case 'VaneVerticalDirection':
|
|
215
215
|
deviceData.Device[key] = value;
|
|
216
|
-
|
|
216
|
+
flag = AirConditioner.EffectiveFlags.VaneVerticalDirection;
|
|
217
217
|
break;
|
|
218
218
|
case 'HideVaneControls':
|
|
219
219
|
if (this.accountType === 'melcloudhome') return;
|
|
220
220
|
|
|
221
221
|
deviceData[key] = value;
|
|
222
|
-
|
|
222
|
+
flag = AirConditioner.EffectiveFlags.Prohibit;
|
|
223
223
|
break;
|
|
224
224
|
case 'HideDryModeControl':
|
|
225
225
|
if (this.accountType === 'melcloudhome') return;
|
|
226
226
|
|
|
227
227
|
deviceData[key] = value;
|
|
228
|
-
|
|
228
|
+
flag = AirConditioner.EffectiveFlags.Prohibit;
|
|
229
229
|
break;
|
|
230
230
|
case 'ProhibitSetTemperature':
|
|
231
231
|
if (this.accountType === 'melcloudhome') return;
|
|
232
232
|
|
|
233
233
|
deviceData.Device[key] = value;
|
|
234
|
-
|
|
234
|
+
flag = AirConditioner.EffectiveFlags.Prohibit;
|
|
235
235
|
break;
|
|
236
236
|
case 'ProhibitOperationMode':
|
|
237
237
|
if (this.accountType === 'melcloudhome') return;
|
|
238
238
|
|
|
239
239
|
deviceData.Device[key] = value;
|
|
240
|
-
|
|
240
|
+
flag = AirConditioner.EffectiveFlags.Prohibit;
|
|
241
241
|
break;
|
|
242
242
|
case 'ProhibitPower':
|
|
243
243
|
if (this.accountType === 'melcloudhome') return;
|
|
244
244
|
|
|
245
245
|
deviceData.Device[key] = value;
|
|
246
|
-
|
|
246
|
+
flag = AirConditioner.EffectiveFlags.Prohibit;
|
|
247
247
|
break;
|
|
248
248
|
case 'FrostProtection':
|
|
249
249
|
if (this.accountType === 'melcloud') return;
|
|
250
250
|
|
|
251
251
|
deviceData.Device[key].Enabled = value;
|
|
252
|
-
|
|
252
|
+
flag = 'frostprotection';
|
|
253
253
|
break;
|
|
254
254
|
case 'OverheatProtection':
|
|
255
255
|
if (this.accountType === 'melcloud') return;
|
|
256
256
|
|
|
257
257
|
deviceData.Device[key].Enabled = value;
|
|
258
|
-
|
|
258
|
+
flag = 'overheatprotection';
|
|
259
259
|
break;
|
|
260
260
|
case 'ScheduleEnabled':
|
|
261
261
|
if (this.accountType === 'melcloud') return;
|
|
262
262
|
|
|
263
263
|
deviceData.Device[key].Enabled = value;
|
|
264
|
-
|
|
264
|
+
flag = 'schedule';
|
|
265
265
|
break;
|
|
266
266
|
case 'HolidayMode':
|
|
267
267
|
if (this.accountType === 'melcloud') return;
|
|
268
268
|
|
|
269
269
|
deviceData.Device[key].Enabled = value;
|
|
270
|
-
|
|
270
|
+
flag = 'holidaymode';
|
|
271
271
|
break;
|
|
272
272
|
default:
|
|
273
273
|
this.emit('warn', `${integration}, received key: ${key}, value: ${value}`);
|
|
274
274
|
break;
|
|
275
275
|
};
|
|
276
276
|
|
|
277
|
-
set = await this.melCloudAta.send(this.accountType, this.displayType, deviceData,
|
|
277
|
+
set = await this.melCloudAta.send(this.accountType, this.displayType, deviceData, flag);
|
|
278
278
|
return set;
|
|
279
279
|
} catch (error) {
|
|
280
280
|
throw new Error(`${integration} set key: ${key}, value: ${value}, error: ${error.message ?? error}`);
|
|
@@ -551,32 +551,32 @@ class DeviceAta extends EventEmitter {
|
|
|
551
551
|
})
|
|
552
552
|
.onSet(async (value) => {
|
|
553
553
|
try {
|
|
554
|
-
let
|
|
554
|
+
let flag = null;
|
|
555
555
|
switch (value) {
|
|
556
556
|
case 0: //OFF - POWER OFF
|
|
557
557
|
value = deviceData.Device.OperationMode;
|
|
558
558
|
deviceData.Device.Power = false;
|
|
559
|
-
|
|
559
|
+
flag = AirConditioner.EffectiveFlags.Power;
|
|
560
560
|
break;
|
|
561
561
|
case 1: //HEAT - HEAT
|
|
562
562
|
deviceData.Device.Power = true;
|
|
563
563
|
value = heatDryFanMode;
|
|
564
|
-
|
|
564
|
+
flag = AirConditioner.EffectiveFlags.PowerOperationModeSetTemperature;
|
|
565
565
|
break;
|
|
566
566
|
case 2: //COOL - COOL
|
|
567
567
|
value = coolDryFanMode;
|
|
568
568
|
deviceData.Device.Power = true;
|
|
569
|
-
|
|
569
|
+
flag = AirConditioner.EffectiveFlags.PowerOperationModeSetTemperature
|
|
570
570
|
break;
|
|
571
571
|
case 3: //AUTO - AUTO
|
|
572
572
|
value = autoDryFanMode;
|
|
573
573
|
deviceData.Device.Power = true;
|
|
574
|
-
|
|
574
|
+
flag = AirConditioner.EffectiveFlags.PowerOperationModeSetTemperature;
|
|
575
575
|
break;
|
|
576
576
|
};
|
|
577
577
|
|
|
578
578
|
deviceData.Device.OperationMode = value;
|
|
579
|
-
await this.melCloudAta.send(this.accountType, this.displayType, deviceData,
|
|
579
|
+
await this.melCloudAta.send(this.accountType, this.displayType, deviceData, flag);
|
|
580
580
|
const operationModeText = AirConditioner.OperationModeMapEnumToString[value];
|
|
581
581
|
if (this.logInfo) this.emit('info', `Set operation mode: ${operationModeText}`);
|
|
582
582
|
} catch (error) {
|
|
@@ -1050,47 +1050,47 @@ class DeviceAta extends EventEmitter {
|
|
|
1050
1050
|
.onSet(async (state) => {
|
|
1051
1051
|
try {
|
|
1052
1052
|
const fanKey = this.accountType === 'melcloud' ? 'FanSpeed' : 'SetFanSpeed';
|
|
1053
|
-
let
|
|
1053
|
+
let flag = null;
|
|
1054
1054
|
switch (mode) {
|
|
1055
1055
|
case 0: //POWER ON,OFF
|
|
1056
1056
|
deviceData.Device.Power = state;
|
|
1057
|
-
|
|
1057
|
+
flag = AirConditioner.EffectiveFlags.Power;
|
|
1058
1058
|
break;
|
|
1059
1059
|
case 1: //OPERATING MODE HEAT
|
|
1060
1060
|
button.previousValue = state ? deviceData.Device.OperationMode : button.previousValue ?? deviceData.Device.OperationMode;
|
|
1061
1061
|
deviceData.Device.Power = true;
|
|
1062
1062
|
deviceData.Device.OperationMode = state ? 1 : button.previousValue === 9 ? 1 : button.previousValue;
|
|
1063
|
-
|
|
1063
|
+
flag = AirConditioner.EffectiveFlags.PowerOperationModeSetTemperature;
|
|
1064
1064
|
break;
|
|
1065
1065
|
case 2: //OPERATING MODE DRY
|
|
1066
1066
|
button.previousValue = state ? deviceData.Device.OperationMode : button.previousValue ?? deviceData.Device.OperationMode;
|
|
1067
1067
|
deviceData.Device.Power = true;
|
|
1068
1068
|
deviceData.Device.OperationMode = state ? 2 : button.previousValue === 10 ? 2 : button.previousValue;
|
|
1069
|
-
|
|
1069
|
+
flag = AirConditioner.EffectiveFlags.PowerOperationModeSetTemperature;
|
|
1070
1070
|
break
|
|
1071
1071
|
case 3: //OPERATING MODE COOL
|
|
1072
1072
|
button.previousValue = state ? deviceData.Device.OperationMode : button.previousValue ?? deviceData.Device.OperationMode;
|
|
1073
1073
|
deviceData.Device.Power = true;
|
|
1074
1074
|
deviceData.Device.OperationMode = state ? 3 : button.previousValue === 11 ? 3 : button.previousValue;
|
|
1075
|
-
|
|
1075
|
+
flag = AirConditioner.EffectiveFlags.PowerOperationModeSetTemperature;
|
|
1076
1076
|
break;
|
|
1077
1077
|
case 4: //OPERATING MODE FAN
|
|
1078
1078
|
button.previousValue = state ? deviceData.Device.OperationMode : button.previousValue ?? deviceData.Device.OperationMode;
|
|
1079
1079
|
deviceData.Device.Power = true;
|
|
1080
1080
|
deviceData.Device.OperationMode = state ? 7 : button.previousValue;
|
|
1081
|
-
|
|
1081
|
+
flag = AirConditioner.EffectiveFlags.PowerOperationModeSetTemperature;
|
|
1082
1082
|
break;
|
|
1083
1083
|
case 5: //OPERATING MODE AUTO
|
|
1084
1084
|
button.previousValue = state ? deviceData.Device.OperationMode : button.previousValue ?? deviceData.Device.OperationMode;
|
|
1085
1085
|
deviceData.Device.Power = true;
|
|
1086
1086
|
deviceData.Device.OperationMode = state ? 8 : button.previousValue;
|
|
1087
|
-
|
|
1087
|
+
flag = AirConditioner.EffectiveFlags.PowerOperationModeSetTemperature;
|
|
1088
1088
|
break;
|
|
1089
1089
|
case 6: //OPERATING MODE PURIFY
|
|
1090
1090
|
button.previousValue = state ? deviceData.Device.OperationMode : button.previousValue ?? deviceData.Device.OperationMode;
|
|
1091
1091
|
deviceData.Device.Power = true;
|
|
1092
1092
|
deviceData.Device.OperationMode = state ? 12 : button.previousValue;
|
|
1093
|
-
|
|
1093
|
+
flag = AirConditioner.EffectiveFlags.PowerOperationModeSetTemperature;
|
|
1094
1094
|
break;
|
|
1095
1095
|
case 7: //OPERATING MODE DRY CONTROL HIDE
|
|
1096
1096
|
deviceData.HideDryModeControl = state;
|
|
@@ -1099,91 +1099,91 @@ class DeviceAta extends EventEmitter {
|
|
|
1099
1099
|
button.previousValue = state ? deviceData.Device.VaneHorizontalDirection : button.previousValue ?? deviceData.Device.VaneHorizontalDirection;
|
|
1100
1100
|
deviceData.Device.Power = true;
|
|
1101
1101
|
deviceData.Device.VaneHorizontalDirection = state ? 0 : button.previousValue;
|
|
1102
|
-
|
|
1102
|
+
flag = AirConditioner.EffectiveFlags.PowerVaneHorizontal;
|
|
1103
1103
|
break;
|
|
1104
1104
|
case 11: //VANE H SWING MODE 1
|
|
1105
1105
|
button.previousValue = state ? deviceData.Device.VaneHorizontalDirection : button.previousValue ?? deviceData.Device.VaneHorizontalDirection;
|
|
1106
1106
|
deviceData.Device.Power = true;
|
|
1107
1107
|
deviceData.Device.VaneHorizontalDirection = state ? 1 : button.previousValue;
|
|
1108
|
-
|
|
1108
|
+
flag = AirConditioner.EffectiveFlags.PowerVaneHorizontal;
|
|
1109
1109
|
break;
|
|
1110
1110
|
case 12: //VANE H SWING MODE 2
|
|
1111
1111
|
button.previousValue = state ? deviceData.Device.VaneHorizontalDirection : button.previousValue ?? deviceData.Device.VaneHorizontalDirection;
|
|
1112
1112
|
deviceData.Device.Power = true;
|
|
1113
1113
|
deviceData.Device.VaneHorizontalDirection = state ? 2 : button.previousValue;
|
|
1114
|
-
|
|
1114
|
+
flag = AirConditioner.EffectiveFlags.PowerVaneHorizontal;
|
|
1115
1115
|
break;
|
|
1116
1116
|
case 13: //VANE H SWING MODE 3
|
|
1117
1117
|
button.previousValue = state ? deviceData.Device.VaneHorizontalDirection : button.previousValue ?? deviceData.Device.VaneHorizontalDirection;
|
|
1118
1118
|
deviceData.Device.Power = true;
|
|
1119
1119
|
deviceData.Device.VaneHorizontalDirection = state ? 3 : button.previousValue;
|
|
1120
|
-
|
|
1120
|
+
flag = AirConditioner.EffectiveFlags.PowerVaneHorizontal;
|
|
1121
1121
|
break;
|
|
1122
1122
|
case 14: //VANE H SWING MODE 4
|
|
1123
1123
|
button.previousValue = state ? deviceData.Device.VaneHorizontalDirection : button.previousValue ?? deviceData.Device.VaneHorizontalDirection;
|
|
1124
1124
|
deviceData.Device.Power = true;
|
|
1125
1125
|
deviceData.Device.VaneHorizontalDirection = state ? 4 : button.previousValue;
|
|
1126
|
-
|
|
1126
|
+
flag = AirConditioner.EffectiveFlags.PowerVaneHorizontal;
|
|
1127
1127
|
break;
|
|
1128
1128
|
case 15: //VANE H SWING MODE 5
|
|
1129
1129
|
button.previousValue = state ? deviceData.Device.VaneHorizontalDirection : button.previousValue ?? deviceData.Device.VaneHorizontalDirection;
|
|
1130
1130
|
deviceData.Device.Power = true;
|
|
1131
1131
|
deviceData.Device.VaneHorizontalDirection = state ? 5 : button.previousValue;
|
|
1132
|
-
|
|
1132
|
+
flag = AirConditioner.EffectiveFlags.PowerVaneHorizontal;
|
|
1133
1133
|
break;
|
|
1134
1134
|
case 16: //VANE H SWING MODE SPLIT
|
|
1135
1135
|
button.previousValue = state ? deviceData.Device.VaneHorizontalDirection : button.previousValue ?? deviceData.Device.VaneHorizontalDirection;
|
|
1136
1136
|
deviceData.Device.Power = true;
|
|
1137
1137
|
deviceData.Device.VaneHorizontalDirection = state ? 8 : button.previousValue;
|
|
1138
|
-
|
|
1138
|
+
flag = AirConditioner.EffectiveFlags.PowerVaneHorizontal;
|
|
1139
1139
|
break;
|
|
1140
1140
|
case 17: //VANE H SWING MODE SWING
|
|
1141
1141
|
button.previousValue = state ? deviceData.Device.VaneHorizontalDirection : button.previousValue ?? deviceData.Device.VaneHorizontalDirection;
|
|
1142
1142
|
deviceData.Device.Power = true;
|
|
1143
1143
|
deviceData.Device.VaneHorizontalDirection = state ? 12 : button.previousValue;
|
|
1144
|
-
|
|
1144
|
+
flag = AirConditioner.EffectiveFlags.PowerVaneHorizontal;
|
|
1145
1145
|
break;
|
|
1146
1146
|
case 20: //VANE V SWING MODE AUTO
|
|
1147
1147
|
button.previousValue = state ? deviceData.Device.VaneVerticalDirection : button.previousValue ?? deviceData.Device.VaneVerticalDirection;
|
|
1148
1148
|
deviceData.Device.Power = true;
|
|
1149
1149
|
deviceData.Device.VaneVerticalDirection = state ? 0 : button.previousValue;
|
|
1150
|
-
|
|
1150
|
+
flag = AirConditioner.EffectiveFlags.PowerVaneVertical;
|
|
1151
1151
|
break;
|
|
1152
1152
|
case 21: //VANE V SWING MODE 1
|
|
1153
1153
|
button.previousValue = state ? deviceData.Device.VaneVerticalDirection : button.previousValue ?? deviceData.Device.VaneVerticalDirection;
|
|
1154
1154
|
deviceData.Device.Power = true;
|
|
1155
1155
|
deviceData.Device.VaneVerticalDirection = state ? 1 : button.previousValue;
|
|
1156
|
-
|
|
1156
|
+
flag = AirConditioner.EffectiveFlags.PowerVaneVertical;
|
|
1157
1157
|
break;
|
|
1158
1158
|
case 22: //VANE V SWING MODE 2
|
|
1159
1159
|
button.previousValue = state ? deviceData.Device.VaneVerticalDirection : button.previousValue ?? deviceData.Device.VaneVerticalDirection;
|
|
1160
1160
|
deviceData.Device.Power = true;
|
|
1161
1161
|
deviceData.Device.VaneVerticalDirection = state ? 2 : button.previousValue;
|
|
1162
|
-
|
|
1162
|
+
flag = AirConditioner.EffectiveFlags.PowerVaneVertical;
|
|
1163
1163
|
break;
|
|
1164
1164
|
case 23: //VANE V SWING MODE 3
|
|
1165
1165
|
button.previousValue = state ? deviceData.Device.VaneVerticalDirection : button.previousValue ?? deviceData.Device.VaneVerticalDirection;
|
|
1166
1166
|
deviceData.Device.Power = true;
|
|
1167
1167
|
deviceData.Device.VaneVerticalDirection = state ? 3 : button.previousValue;
|
|
1168
|
-
|
|
1168
|
+
flag = AirConditioner.EffectiveFlags.PowerVaneVertical;
|
|
1169
1169
|
break;
|
|
1170
1170
|
case 24: //VANE V SWING MODE 4
|
|
1171
1171
|
button.previousValue = state ? deviceData.Device.VaneVerticalDirection : button.previousValue ?? deviceData.Device.VaneVerticalDirection;
|
|
1172
1172
|
deviceData.Device.Power = true;
|
|
1173
1173
|
deviceData.Device.VaneVerticalDirection = state ? 4 : button.previousValue;
|
|
1174
|
-
|
|
1174
|
+
flag = AirConditioner.EffectiveFlags.PowerVaneVertical;
|
|
1175
1175
|
break;
|
|
1176
1176
|
case 25: //VANE V SWING MODE 5
|
|
1177
1177
|
button.previousValue = state ? deviceData.Device.VaneVerticalDirection : button.previousValue ?? deviceData.Device.VaneVerticalDirection;
|
|
1178
1178
|
deviceData.Device.Power = true;
|
|
1179
1179
|
deviceData.Device.VaneVerticalDirection = state ? 5 : button.previousValue;
|
|
1180
|
-
|
|
1180
|
+
flag = AirConditioner.EffectiveFlags.PowerVaneVertical;
|
|
1181
1181
|
break;
|
|
1182
1182
|
case 26: //VANE V SWING MODE SWING
|
|
1183
1183
|
button.previousValue = state ? deviceData.Device.VaneVerticalDirection : button.previousValue ?? deviceData.Device.VaneVerticalDirection;
|
|
1184
1184
|
deviceData.Device.Power = true;
|
|
1185
1185
|
deviceData.Device.VaneVerticalDirection = state ? 7 : button.previousValue;
|
|
1186
|
-
|
|
1186
|
+
flag = AirConditioner.EffectiveFlags.PowerVaneVertical;
|
|
1187
1187
|
break;
|
|
1188
1188
|
case 27: //VANE H/V CONTROLS HIDE
|
|
1189
1189
|
deviceData.HideVaneControls = state;
|
|
@@ -1192,68 +1192,68 @@ class DeviceAta extends EventEmitter {
|
|
|
1192
1192
|
button.previousValue = state ? deviceData.Device[fanKey] : button.previousValue ?? deviceData.Device[fanKey];
|
|
1193
1193
|
deviceData.Device.Power = true;
|
|
1194
1194
|
deviceData.Device[fanKey] = state ? 0 : button.previousValue;
|
|
1195
|
-
|
|
1195
|
+
flag = AirConditioner.EffectiveFlags.PowerSetFanSpeed;
|
|
1196
1196
|
break;
|
|
1197
1197
|
case 31: //FAN SPEED MODE 1
|
|
1198
1198
|
button.previousValue = state ? deviceData.Device[fanKey] : button.previousValue ?? deviceData.Device[fanKey];
|
|
1199
1199
|
deviceData.Device.Power = true;
|
|
1200
1200
|
deviceData.Device[fanKey] = state ? 1 : button.previousValue;
|
|
1201
|
-
|
|
1201
|
+
flag = AirConditioner.EffectiveFlags.PowerSetFanSpeed;
|
|
1202
1202
|
break;
|
|
1203
1203
|
case 32: //FAN SPEED MODE 2
|
|
1204
1204
|
button.previousValue = state ? deviceData.Device[fanKey] : button.previousValue ?? deviceData.Device[fanKey];
|
|
1205
1205
|
deviceData.Device.Power = true;
|
|
1206
1206
|
deviceData.Device[fanKey] = state ? 2 : button.previousValue;
|
|
1207
|
-
|
|
1207
|
+
flag = AirConditioner.EffectiveFlags.PowerSetFanSpeed;
|
|
1208
1208
|
break;
|
|
1209
1209
|
case 33: //FAN SPEED MODE 3
|
|
1210
1210
|
button.previousValue = state ? deviceData.Device[fanKey] : button.previousValue ?? deviceData.Device[fanKey];
|
|
1211
1211
|
deviceData.Device.Power = true;
|
|
1212
1212
|
deviceData.Device[fanKey] = state ? 3 : button.previousValue;
|
|
1213
|
-
|
|
1213
|
+
flag = AirConditioner.EffectiveFlags.PowerSetFanSpeed;
|
|
1214
1214
|
break;
|
|
1215
1215
|
case 34: //FAN MODE 4
|
|
1216
1216
|
button.previousValue = state ? deviceData.Device[fanKey] : button.previousValue ?? deviceData.Device[fanKey];
|
|
1217
1217
|
deviceData.Device.Power = true;
|
|
1218
1218
|
deviceData.Device[fanKey] = state ? 4 : button.previousValue;
|
|
1219
|
-
|
|
1219
|
+
flag = AirConditioner.EffectiveFlags.PowerSetFanSpeed;
|
|
1220
1220
|
break;
|
|
1221
1221
|
case 35: //FAN SPEED MODE 5
|
|
1222
1222
|
button.previousValue = state ? deviceData.Device[fanKey] : button.previousValue ?? deviceData.Device[fanKey];
|
|
1223
1223
|
deviceData.Device.Power = true;
|
|
1224
1224
|
deviceData.Device[fanKey] = state ? 5 : button.previousValue;
|
|
1225
|
-
|
|
1225
|
+
flag = AirConditioner.EffectiveFlags.PowerSetFanSpeed;
|
|
1226
1226
|
break;
|
|
1227
1227
|
case 36: //FAN SPEED MODE 6
|
|
1228
1228
|
button.previousValue = state ? deviceData.Device[fanKey] : button.previousValue ?? deviceData.Device[fanKey];
|
|
1229
1229
|
deviceData.Device.Power = true;
|
|
1230
1230
|
deviceData.Device[fanKey] = state ? 6 : button.previousValue;
|
|
1231
|
-
|
|
1231
|
+
flag = AirConditioner.EffectiveFlags.PowerSetFanSpeed;
|
|
1232
1232
|
break;
|
|
1233
1233
|
case 37: //PHYSICAL LOCK CONTROLS
|
|
1234
1234
|
deviceData.Device.ProhibitSetTemperature = state;
|
|
1235
1235
|
deviceData.Device.ProhibitOperationMode = state;
|
|
1236
1236
|
deviceData.Device.ProhibitPower = state;
|
|
1237
|
-
|
|
1237
|
+
flag = AirConditioner.EffectiveFlags.Prohibit;
|
|
1238
1238
|
break;
|
|
1239
1239
|
case 38: //PHYSICAL LOCK CONTROLS POWER
|
|
1240
1240
|
deviceData.Device.ProhibitPower = state;
|
|
1241
|
-
|
|
1241
|
+
flag = AirConditioner.EffectiveFlags.Prohibit;
|
|
1242
1242
|
break;
|
|
1243
1243
|
case 39: //PHYSICAL LOCK CONTROLS MODE
|
|
1244
1244
|
deviceData.Device.ProhibitOperationMode = state;
|
|
1245
|
-
|
|
1245
|
+
flag = AirConditioner.EffectiveFlags.Prohibit;
|
|
1246
1246
|
break;
|
|
1247
1247
|
case 40: //PHYSICAL LOCK CONTROLS TEMP
|
|
1248
1248
|
deviceData.Device.ProhibitSetTemperature = state;
|
|
1249
|
-
|
|
1249
|
+
flag = AirConditioner.EffectiveFlags.Prohibit;
|
|
1250
1250
|
break;
|
|
1251
1251
|
default:
|
|
1252
1252
|
if (this.logWarn) this.emit('warn', `Unknown button mode: ${mode}`);
|
|
1253
1253
|
break;
|
|
1254
1254
|
};
|
|
1255
1255
|
|
|
1256
|
-
await this.melCloudAta.send(this.accountType, this.displayType, deviceData,
|
|
1256
|
+
await this.melCloudAta.send(this.accountType, this.displayType, deviceData, flag);
|
|
1257
1257
|
if (this.logInfo) this.emit('info', `${state ? `Set: ${name}` : `Unset: ${name}, Set: ${button.previousValue}`}`);
|
|
1258
1258
|
} catch (error) {
|
|
1259
1259
|
if (this.logWarn) this.emit('warn', `Set button error: ${error}`);
|