homebridge-melcloud-control 4.10.20-beta.6 → 4.11.0

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 CHANGED
@@ -18,12 +18,26 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
18
18
  - v4 Added support for MELCloud Home.
19
19
  - v4.1 Changed accessory category for ATA devices, required add accessory to KomeKit again
20
20
  - v4.6 Added support for Homebridge UI >= v5.13.0
21
+ - v4.11.0 Changed RotationSpeed range for ATA/ERV (Auto moved to the top slot, 0 is now "off" only), if Home still shows the old range, remove and re-add the accessory
21
22
 
22
23
  ## Warning
23
24
 
24
25
  - For plugin < v4.6.0 use Homebridge UI <= v5.5.0
25
26
  - For plugin >= v4.6.0 use Homebridge UI >= v5.13.0
26
27
 
28
+ ## [4.11.0] - (23.09.2026)
29
+
30
+ ### Changes
31
+
32
+ - fix: [#259](https://github.com/grzegorz914/homebridge-melcloud-control/issues/259) - turning ON an ATA/ERV unit from Apple Home could silently override Auto fan speed with a fixed speed. Apple Home's combined HeaterCooler dial sends a stray RotationSpeed value together with Active on every power-on, and Auto (raw `0`) shared the same dial position as "off". `MelCloudAta`/`MelCloudAtw`/`MelCloudErv` `send()` now diffs the outgoing command against live device state and only sends fields that actually changed, and RotationSpeed for ATA/ERV is remapped so `0` is reserved exclusively for "off" (matching HomeKit's own dial semantics), with Auto moved to the top slot past the highest real speed
33
+ - fix: ERV RotationSpeed `onGet` read `this.accessory.fanSpeed`, a field that was never populated (only `currentFanSpeed` was set), so the characteristic never reported a value
34
+ - changed: `MelCloudAtw.send()` now diffs against live device state the same way as ATA/ERV and rebuilds `EffectiveFlags` from only the fields that actually changed (using `+` rather than `|` to combine bits, since some HeatPump flags exceed 32 bits and would silently truncate under bitwise OR in JS)
35
+ - cleanup: removed the now-redundant explicit `EffectiveFlags` arguments passed from `deviceata.js`/`deviceatw.js`/`deviceerv.js` to `send()`. The value is fully recomputed from the changed payload keys, so the caller-supplied numeric flag was dead code. The special string flags (`'account'`, `'frostprotection'`, `'overheatprotection'`, `'holidaymode'`, `'schedule'`, `'scene'`) are unaffected
36
+ - fix: ATW classic MELCloud `HolidayMode` changes were missing a matching bit in the rebuilt `EffectiveFlags` table, so the mode change would not have been applied
37
+ - bump dependencies
38
+ - cleanup
39
+ - readme update
40
+
27
41
  ## [4.10.19] - (13.09.2026)
28
42
 
29
43
  ### Changes
package/README.md CHANGED
@@ -55,7 +55,7 @@
55
55
  * Power `ON/OFF`.
56
56
  * Operating mode `AUTO/HEAT/COOL/POWER OFF`.
57
57
  * Temperature `HEATING/COOLING/AUTO`.
58
- * Fan speed `AUTO/1/2/3/4/5`.
58
+ * Fan speed `OFF/N-SPEEDS/AUTO`.
59
59
  * Swing mode `AUTO/SWING`.
60
60
  * Physical lock controls `LOCK/UNLOCK`.
61
61
  * Temperature display unit `°F/°C`.
@@ -162,7 +162,7 @@
162
162
  * Heater Cooler:
163
163
  * Power `ON/OFF`.
164
164
  * Operating mode `AUTO/HEAT/COOL/POWER OFF` - `AUTO, LOSSNAY, BYPASS, POWER OFF`.
165
- * Fan speed `AUTO/1/2/3/4`.
165
+ * Fan speed `OFF/N-SPEEDS/AUTO`.
166
166
  * Temperature display unit `°F/°C`.
167
167
  * Thermostat:
168
168
  * Power `ON/OFF`.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "displayName": "MELCloud Control",
3
3
  "name": "homebridge-melcloud-control",
4
- "version": "4.10.20-beta.6",
4
+ "version": "4.11.0",
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
@@ -120,47 +120,37 @@ class DeviceAta extends EventEmitter {
120
120
  break;
121
121
  case 'OperationMode':
122
122
  payload.operationMode = value;
123
- flag = AirConditioner.EffectiveFlags.OperationMode
124
123
  break;
125
124
  case 'SetTemperature':
126
125
  payload.setTemperature = value;
127
- flag = AirConditioner.EffectiveFlags.SetTemperature;
128
126
  break;
129
127
  case 'DefaultCoolingSetTemperature':
130
128
  payload.defaultCoolingSetTemperature = value;
131
- flag = AirConditioner.EffectiveFlags.SetTemperature;
132
129
  break;
133
130
  case 'DefaultHeatingSetTemperature':
134
131
  payload.defaultHeatingSetTemperature = value;
135
- flag = AirConditioner.EffectiveFlags.SetTemperature;
136
132
  break;
137
133
  case 'FanSpeed':
138
134
  key = 'setFanSpeed';
139
135
  payload[key] = value;
140
- flag = AirConditioner.EffectiveFlags.SetFanSpeed;
141
136
  break;
142
137
  case 'VaneHorizontalDirection':
143
138
  payload.vaneHorizontalDirection = value;
144
- flag = AirConditioner.EffectiveFlags.VaneHorizontalDirection;
145
139
  break;
146
140
  case 'VaneVerticalDirection':
147
141
  payload.vaneVerticalDirection = value;
148
- flag = AirConditioner.EffectiveFlags.VaneVerticalDirection;
149
142
  break;
150
143
  case 'ProhibitSetTemperature':
151
144
  if (!accountTypeMelCloud) return;
152
145
  payload.prohibitSetTemperature = value;
153
- flag = AirConditioner.EffectiveFlags.Prohibit;
154
146
  break;
155
147
  case 'ProhibitOperationMode':
156
148
  if (!accountTypeMelCloud) return;
157
149
  payload.prohibitOperationMode = value;
158
- flag = AirConditioner.EffectiveFlags.Prohibit;
159
150
  break;
160
151
  case 'ProhibitPower':
161
152
  if (!accountTypeMelCloud) return;
162
153
  payload.prohibitPower = value;
163
- flag = AirConditioner.EffectiveFlags.Prohibit;
164
154
  break;
165
155
  case 'FrostProtection':
166
156
  if (accountTypeMelCloud) return;
@@ -257,7 +247,7 @@ class DeviceAta extends EventEmitter {
257
247
  const includeMode = state && operationMode != null;
258
248
  if (includeMode) payload.operationMode = operationMode;
259
249
  if (this.logInfo) this.emit('info', `Set power: ${state ? 'On' : 'Off'}`);
260
- await this.melCloudAta.send(this.accountType, this.displayType, deviceData, payload, includeMode ? AirConditioner.EffectiveFlags.OperationMode : null);
250
+ await this.melCloudAta.send(this.accountType, this.displayType, deviceData, payload);
261
251
  } catch (error) {
262
252
  if (this.logWarn) this.emit('warn', `Set power error: ${error}`);
263
253
  };
@@ -293,7 +283,7 @@ class DeviceAta extends EventEmitter {
293
283
 
294
284
  const payload = { operationMode: value };
295
285
  if (this.logInfo) this.emit('info', `Set operation mode: ${AirConditioner.OperationModeMapEnumToString[value]}`);
296
- await this.melCloudAta.send(this.accountType, this.displayType, deviceData, payload, AirConditioner.EffectiveFlags.OperationMode);
286
+ await this.melCloudAta.send(this.accountType, this.displayType, deviceData, payload);
297
287
  } catch (error) {
298
288
  if (this.logWarn) this.emit('warn', `Set operation mode error: ${error}`);
299
289
  };
@@ -316,7 +306,7 @@ class DeviceAta extends EventEmitter {
316
306
  })
317
307
  .onSet(async (value) => {
318
308
  try {
319
- //0 is the dial's floor, paired by HomeKit itself with Active going false; nothing to send, real speeds start at 1
309
+ //0 is the dial's floor, paired by HomeKit itself with Active going false - nothing to send, real speeds start at 1
320
310
  if (value === 0) return;
321
311
 
322
312
  //Auto sits at the top slot, past the highest real speed
@@ -324,7 +314,7 @@ class DeviceAta extends EventEmitter {
324
314
  const clampedValue = isAutoSlot ? 0 : Math.min(Math.max(value, 1), numberOfFanSpeeds);
325
315
  const payload = { setFanSpeed: clampedValue };
326
316
  if (this.logInfo) this.emit('info', `Set fan speed mode: ${AirConditioner.FanSpeedMapEnumToString[clampedValue]}`);
327
- await this.melCloudAta.send(this.accountType, this.displayType, deviceData, payload, AirConditioner.EffectiveFlags.SetFanSpeed);
317
+ await this.melCloudAta.send(this.accountType, this.displayType, deviceData, payload);
328
318
  } catch (error) {
329
319
  if (this.logWarn) this.emit('warn', `Set fan speed mode error: ${error}`);
330
320
  };
@@ -344,7 +334,7 @@ class DeviceAta extends EventEmitter {
344
334
  if (supportsWideVane) payload.vaneHorizontalDirection = value ? 12 : 0;
345
335
  payload.vaneVerticalDirection = value ? 7 : 0;
346
336
  if (this.logInfo) this.emit('info', `Set air direction mode: ${AirConditioner.AirDirectionMapEnumToString[value]}`);
347
- await this.melCloudAta.send(this.accountType, this.displayType, deviceData, payload, AirConditioner.EffectiveFlags.VaneVerticalVaneHorizontal);
337
+ await this.melCloudAta.send(this.accountType, this.displayType, deviceData, payload);
348
338
  } catch (error) {
349
339
  if (this.logWarn) this.emit('warn', `Set air direction mode error: ${error}`);
350
340
  };
@@ -366,7 +356,7 @@ class DeviceAta extends EventEmitter {
366
356
  if (this.accessory.operationMode === 8) deviceData.Device.DefaultCoolingSetTemperature = value < 16 ? 16 : value;
367
357
  const payload = { setTemperature: value < 16 ? 16 : value };
368
358
  if (this.logInfo) this.emit('info', `Set cooling threshold temperature: ${value}${this.accessory.temperatureUnit}`);
369
- await this.melCloudAta.send(this.accountType, this.displayType, deviceData, payload, AirConditioner.EffectiveFlags.SetTemperature);
359
+ await this.melCloudAta.send(this.accountType, this.displayType, deviceData, payload);
370
360
  } catch (error) {
371
361
  if (this.logWarn) this.emit('warn', `Set cooling threshold temperature error: ${error}`);
372
362
  };
@@ -388,7 +378,7 @@ class DeviceAta extends EventEmitter {
388
378
  if (this.accessory.operationMode === 8) deviceData.Device.DefaultHeatingSetTemperature = value;
389
379
  const payload = { setTemperature: value };
390
380
  if (this.logInfo) this.emit('info', `Set heating threshold temperature: ${value}${this.accessory.temperatureUnit}`);
391
- await this.melCloudAta.send(this.accountType, this.displayType, deviceData, payload, AirConditioner.EffectiveFlags.SetTemperature);
381
+ await this.melCloudAta.send(this.accountType, this.displayType, deviceData, payload);
392
382
  } catch (error) {
393
383
  if (this.logWarn) this.emit('warn', `Set heating threshold temperature error: ${error}`);
394
384
  };
@@ -410,7 +400,7 @@ class DeviceAta extends EventEmitter {
410
400
  payload.prohibitOperationMode = value;
411
401
  payload.prohibitPower = value;
412
402
  if (this.logInfo) this.emit('info', `Set local physical controls: ${value ? 'Lock' : 'Unlock'}`);
413
- await this.melCloudAta.send(this.accountType, this.displayType, deviceData, payload, AirConditioner.EffectiveFlags.Prohibit);
403
+ await this.melCloudAta.send(this.accountType, this.displayType, deviceData, payload);
414
404
  } catch (error) {
415
405
  if (this.logWarn) this.emit('warn', `Set lock physical controls error: ${error}`);
416
406
  };
@@ -457,7 +447,6 @@ class DeviceAta extends EventEmitter {
457
447
  })
458
448
  .onSet(async (value) => {
459
449
  try {
460
- let flag = null;
461
450
  let power = null;
462
451
  switch (value) {
463
452
  case 0: //OFF - POWER OFF
@@ -467,23 +456,20 @@ class DeviceAta extends EventEmitter {
467
456
  case 1: //HEAT - HEAT
468
457
  power = true;
469
458
  value = heatDryFanMode;
470
- flag = AirConditioner.EffectiveFlags.OperationModeSetTemperature;
471
459
  break;
472
460
  case 2: //COOL - COOL
473
461
  power = true;
474
462
  value = coolDryFanMode;
475
- flag = AirConditioner.EffectiveFlags.OperationModeSetTemperature
476
463
  break;
477
464
  case 3: //AUTO - AUTO
478
465
  power = true;
479
466
  value = autoDryFanMode;
480
- flag = AirConditioner.EffectiveFlags.OperationModeSetTemperature;
481
467
  break;
482
468
  };
483
469
 
484
470
  const payload = { power, operationMode: value };
485
471
  if (this.logInfo) this.emit('info', `Set operation mode: ${AirConditioner.OperationModeMapEnumToString[value]}`);
486
- await this.melCloudAta.send(this.accountType, this.displayType, deviceData, payload, flag);
472
+ await this.melCloudAta.send(this.accountType, this.displayType, deviceData, payload);
487
473
  } catch (error) {
488
474
  if (this.logWarn) this.emit('warn', `Set operation mode error: ${error}`);
489
475
  };
@@ -513,7 +499,7 @@ class DeviceAta extends EventEmitter {
513
499
 
514
500
  const payload = { setTemperature: value };
515
501
  if (this.logInfo) this.emit('info', `Set temperature: ${value}${this.accessory.temperatureUnit}`);
516
- await this.melCloudAta.send(this.accountType, this.displayType, deviceData, payload, AirConditioner.EffectiveFlags.SetTemperature);
502
+ await this.melCloudAta.send(this.accountType, this.displayType, deviceData, payload);
517
503
  } catch (error) {
518
504
  if (this.logWarn) this.emit('warn', `Set temperature error: ${error}`);
519
505
  };
@@ -954,7 +940,7 @@ class DeviceAta extends EventEmitter {
954
940
  };
955
941
 
956
942
  if (this.logInfo) this.emit('info', `Preset: ${name}: ${state ? 'Set' : 'Unset'}`);
957
- await this.melCloudAta.send(this.accountType, this.displayType, deviceData, payload, AirConditioner.EffectiveFlags.Presets);
943
+ await this.melCloudAta.send(this.accountType, this.displayType, deviceData, payload);
958
944
  } catch (error) {
959
945
  if (this.logWarn) this.emit('warn', `Set preset error: ${error}`);
960
946
  };
@@ -1148,7 +1134,6 @@ class DeviceAta extends EventEmitter {
1148
1134
  const fanKey = accountTypeMelCloud ? 'FanSpeed' : 'SetFanSpeed';
1149
1135
  const fanKeySet = 'setFanSpeed';
1150
1136
  let payload = {};
1151
- let flag = null;
1152
1137
  switch (mode) {
1153
1138
  case 0: //POWER ON,OFF
1154
1139
  payload.power = state;
@@ -1156,163 +1141,131 @@ class DeviceAta extends EventEmitter {
1156
1141
  case 1: //OPERATING MODE HEAT
1157
1142
  button.previousValue = state ? deviceData.Device.OperationMode : button.previousValue ?? deviceData.Device.OperationMode;
1158
1143
  payload.operationMode = state ? 1 : button.previousValue === 9 ? 1 : button.previousValue;
1159
- flag = AirConditioner.EffectiveFlags.OperationModeSetTemperature;
1160
1144
  break;
1161
1145
  case 2: //OPERATING MODE DRY
1162
1146
  button.previousValue = state ? deviceData.Device.OperationMode : button.previousValue ?? deviceData.Device.OperationMode;
1163
1147
  payload.operationMode = state ? 2 : button.previousValue === 10 ? 2 : button.previousValue;
1164
- flag = AirConditioner.EffectiveFlags.OperationModeSetTemperature;
1165
1148
  break
1166
1149
  case 3: //OPERATING MODE COOL
1167
1150
  button.previousValue = state ? deviceData.Device.OperationMode : button.previousValue ?? deviceData.Device.OperationMode;
1168
1151
  payload.operationMode = state ? 3 : button.previousValue === 11 ? 3 : button.previousValue;
1169
- flag = AirConditioner.EffectiveFlags.OperationModeSetTemperature;
1170
1152
  break;
1171
1153
  case 4: //OPERATING MODE FAN
1172
1154
  button.previousValue = state ? deviceData.Device.OperationMode : button.previousValue ?? deviceData.Device.OperationMode;
1173
1155
  payload.operationMode = state ? 7 : button.previousValue;
1174
- flag = AirConditioner.EffectiveFlags.OperationModeSetTemperature;
1175
1156
  break;
1176
1157
  case 5: //OPERATING MODE AUTO
1177
1158
  button.previousValue = state ? deviceData.Device.OperationMode : button.previousValue ?? deviceData.Device.OperationMode;
1178
1159
  payload.operationMode = state ? 8 : button.previousValue;
1179
- flag = AirConditioner.EffectiveFlags.OperationModeSetTemperature;
1180
1160
  break;
1181
1161
  case 6: //OPERATING MODE PURIFY
1182
1162
  button.previousValue = state ? deviceData.Device.OperationMode : button.previousValue ?? deviceData.Device.OperationMode;
1183
1163
  payload.operationMode = state ? 12 : button.previousValue;
1184
- flag = AirConditioner.EffectiveFlags.OperationModeSetTemperature;
1185
1164
  break;
1186
1165
  case 10: //VANE H MODE AUTO
1187
1166
  button.previousValue = state ? deviceData.Device.VaneHorizontalDirection : button.previousValue ?? deviceData.Device.VaneHorizontalDirection;
1188
1167
  payload.vaneHorizontalDirection = state ? 0 : button.previousValue;
1189
- flag = AirConditioner.EffectiveFlags.VaneHorizontal;
1190
1168
  break;
1191
1169
  case 11: //VANE H MODE 1
1192
1170
  button.previousValue = state ? deviceData.Device.VaneHorizontalDirection : button.previousValue ?? deviceData.Device.VaneHorizontalDirection;
1193
1171
  payload.vaneHorizontalDirection = state ? 1 : button.previousValue;
1194
- flag = AirConditioner.EffectiveFlags.VaneHorizontal;
1195
1172
  break;
1196
1173
  case 12: //VANE H MODE 2
1197
1174
  button.previousValue = state ? deviceData.Device.VaneHorizontalDirection : button.previousValue ?? deviceData.Device.VaneHorizontalDirection;
1198
1175
  payload.vaneHorizontalDirection = state ? 2 : button.previousValue;
1199
- flag = AirConditioner.EffectiveFlags.VaneHorizontal;
1200
1176
  break;
1201
1177
  case 13: //VANE H MODE 3
1202
1178
  button.previousValue = state ? deviceData.Device.VaneHorizontalDirection : button.previousValue ?? deviceData.Device.VaneHorizontalDirection;
1203
1179
  payload.vaneHorizontalDirection = state ? 3 : button.previousValue;
1204
- flag = AirConditioner.EffectiveFlags.VaneHorizontal;
1205
1180
  break;
1206
1181
  case 14: //VANE H MODE 4
1207
1182
  button.previousValue = state ? deviceData.Device.VaneHorizontalDirection : button.previousValue ?? deviceData.Device.VaneHorizontalDirection;
1208
1183
  payload.vaneHorizontalDirection = state ? 4 : button.previousValue;
1209
- flag = AirConditioner.EffectiveFlags.VaneHorizontal;
1210
1184
  break;
1211
1185
  case 15: //VANE H MODE 5
1212
1186
  button.previousValue = state ? deviceData.Device.VaneHorizontalDirection : button.previousValue ?? deviceData.Device.VaneHorizontalDirection;
1213
1187
  payload.vaneHorizontalDirection = state ? 5 : button.previousValue;
1214
- flag = AirConditioner.EffectiveFlags.VaneHorizontal;
1215
1188
  break;
1216
1189
  case 16: //VANE H MODE SPLIT
1217
1190
  button.previousValue = state ? deviceData.Device.VaneHorizontalDirection : button.previousValue ?? deviceData.Device.VaneHorizontalDirection;
1218
1191
  payload.vaneHorizontalDirection = state ? 8 : button.previousValue;
1219
- flag = AirConditioner.EffectiveFlags.VaneHorizontal;
1220
1192
  break;
1221
1193
  case 17: //VANE H MODE SWING
1222
1194
  button.previousValue = state ? deviceData.Device.VaneHorizontalDirection : button.previousValue ?? deviceData.Device.VaneHorizontalDirection;
1223
1195
  payload.vaneHorizontalDirection = state ? 12 : button.previousValue;
1224
- flag = AirConditioner.EffectiveFlags.VaneHorizontal;
1225
1196
  break;
1226
1197
  case 20: //VANE V MODE AUTO
1227
1198
  button.previousValue = state ? deviceData.Device.VaneVerticalDirection : button.previousValue ?? deviceData.Device.VaneVerticalDirection;
1228
1199
  payload.vaneVerticalDirection = state ? 0 : button.previousValue;
1229
- flag = AirConditioner.EffectiveFlags.VaneVertical;
1230
1200
  break;
1231
1201
  case 21: //VANE V MODE 1
1232
1202
  button.previousValue = state ? deviceData.Device.VaneVerticalDirection : button.previousValue ?? deviceData.Device.VaneVerticalDirection;
1233
1203
  payload.vaneVerticalDirection = state ? 1 : button.previousValue;
1234
- flag = AirConditioner.EffectiveFlags.VaneVertical;
1235
1204
  break;
1236
1205
  case 22: //VANE V MODE 2
1237
1206
  button.previousValue = state ? deviceData.Device.VaneVerticalDirection : button.previousValue ?? deviceData.Device.VaneVerticalDirection;
1238
1207
  payload.vaneVerticalDirection = state ? 2 : button.previousValue;
1239
- flag = AirConditioner.EffectiveFlags.VaneVertical;
1240
1208
  break;
1241
1209
  case 23: //VANE V MODE 3
1242
1210
  button.previousValue = state ? deviceData.Device.VaneVerticalDirection : button.previousValue ?? deviceData.Device.VaneVerticalDirection;
1243
1211
  payload.vaneVerticalDirection = state ? 3 : button.previousValue;
1244
- flag = AirConditioner.EffectiveFlags.VaneVertical;
1245
1212
  break;
1246
1213
  case 24: //VANE V MODE 4
1247
1214
  button.previousValue = state ? deviceData.Device.VaneVerticalDirection : button.previousValue ?? deviceData.Device.VaneVerticalDirection;
1248
1215
  payload.vaneVerticalDirection = state ? 4 : button.previousValue;
1249
- flag = AirConditioner.EffectiveFlags.VaneVertical;
1250
1216
  break;
1251
1217
  case 25: //VANE V MODE 5
1252
1218
  button.previousValue = state ? deviceData.Device.VaneVerticalDirection : button.previousValue ?? deviceData.Device.VaneVerticalDirection;
1253
1219
  payload.vaneVerticalDirection = state ? 5 : button.previousValue;
1254
- flag = AirConditioner.EffectiveFlags.VaneVertical;
1255
1220
  break;
1256
1221
  case 26: //VANE V MODE SWING
1257
1222
  button.previousValue = state ? deviceData.Device.VaneVerticalDirection : button.previousValue ?? deviceData.Device.VaneVerticalDirection;
1258
1223
  payload.vaneVerticalDirection = state ? 7 : button.previousValue;
1259
- flag = AirConditioner.EffectiveFlags.VaneVertical;
1260
1224
  break;
1261
1225
  case 30: //FAN SPEED MODE AUTO
1262
1226
  button.previousValue = state ? deviceData.Device[fanKey] : button.previousValue ?? deviceData.Device[fanKey];
1263
1227
  payload[fanKeySet] = state ? 0 : button.previousValue;
1264
- flag = AirConditioner.EffectiveFlags.SetFanSpeed;
1265
1228
  break;
1266
1229
  case 31: //FAN SPEED MODE 1
1267
1230
  button.previousValue = state ? deviceData.Device[fanKey] : button.previousValue ?? deviceData.Device[fanKey];
1268
1231
  payload[fanKeySet] = state ? 1 : button.previousValue;
1269
- flag = AirConditioner.EffectiveFlags.SetFanSpeed;
1270
1232
  break;
1271
1233
  case 32: //FAN SPEED MODE 2
1272
1234
  button.previousValue = state ? deviceData.Device[fanKey] : button.previousValue ?? deviceData.Device[fanKey];
1273
1235
  payload[fanKeySet] = state ? 2 : button.previousValue;
1274
- flag = AirConditioner.EffectiveFlags.SetFanSpeed;
1275
1236
  break;
1276
1237
  case 33: //FAN SPEED MODE 3
1277
1238
  button.previousValue = state ? deviceData.Device[fanKey] : button.previousValue ?? deviceData.Device[fanKey];
1278
1239
  payload[fanKeySet] = state ? 3 : button.previousValue;
1279
- flag = AirConditioner.EffectiveFlags.SetFanSpeed;
1280
1240
  break;
1281
1241
  case 34: //FAN MODE 4
1282
1242
  button.previousValue = state ? deviceData.Device[fanKey] : button.previousValue ?? deviceData.Device[fanKey];
1283
1243
  payload[fanKeySet] = state ? 4 : button.previousValue;
1284
- flag = AirConditioner.EffectiveFlags.SetFanSpeed;
1285
1244
  break;
1286
1245
  case 35: //FAN SPEED MODE 5
1287
1246
  button.previousValue = state ? deviceData.Device[fanKey] : button.previousValue ?? deviceData.Device[fanKey];
1288
1247
  payload[fanKeySet] = state ? 5 : button.previousValue;
1289
- flag = AirConditioner.EffectiveFlags.SetFanSpeed;
1290
1248
  break;
1291
1249
  case 36: //FAN SPEED MODE 6
1292
1250
  button.previousValue = state ? deviceData.Device[fanKey] : button.previousValue ?? deviceData.Device[fanKey];
1293
1251
  payload[fanKeySet] = state ? 6 : button.previousValue;
1294
- flag = AirConditioner.EffectiveFlags.SetFanSpeed;
1295
1252
  break;
1296
1253
  case 37: //PHYSICAL LOCK CONTROLS
1297
1254
  if (accountTypeMelCloud) payload.prohibitSetTemperature = state;
1298
1255
  payload.prohibitOperationMode = state;
1299
1256
  if (accountTypeMelCloud) payload.prohibitPower = state;
1300
- flag = AirConditioner.EffectiveFlags.Prohibit;
1301
1257
  break;
1302
1258
  case 38: //PHYSICAL LOCK CONTROLS POWER
1303
1259
  if (!accountTypeMelCloud) return;
1304
1260
  payload.prohibitPower = state;
1305
- flag = AirConditioner.EffectiveFlags.Prohibit;
1306
1261
  break;
1307
1262
  case 39: //PHYSICAL LOCK CONTROLS MODE
1308
1263
  if (!accountTypeMelCloud) return;
1309
1264
  payload.prohibitOperationMode = state;
1310
- flag = AirConditioner.EffectiveFlags.Prohibit;
1311
1265
  break;
1312
1266
  case 40: //PHYSICAL LOCK CONTROLS TEMP
1313
1267
  if (!accountTypeMelCloud) return;
1314
1268
  payload.prohibitSetTemperature = state;
1315
- flag = AirConditioner.EffectiveFlags.Prohibit;
1316
1269
  break;
1317
1270
  default:
1318
1271
  if (this.logWarn) this.emit('warn', `Received unknown button mode: ${mode}`);
@@ -1320,7 +1273,7 @@ class DeviceAta extends EventEmitter {
1320
1273
  };
1321
1274
 
1322
1275
  if (this.logInfo) this.emit('info', `Button ${name}: ${state ? `Enabled` : `Disabled`}`);
1323
- await this.melCloudAta.send(this.accountType, this.displayType, deviceData, payload, flag);
1276
+ await this.melCloudAta.send(this.accountType, this.displayType, deviceData, payload);
1324
1277
  } catch (error) {
1325
1278
  if (this.logWarn) this.emit('warn', `Set button error: ${error}`);
1326
1279
  };
@@ -1571,7 +1524,7 @@ class DeviceAta extends EventEmitter {
1571
1524
 
1572
1525
  //fan speed mode
1573
1526
  if (supportsFanSpeed) {
1574
- //0 is the dial's floor (paired with off), never sent as a real speed; Auto sits at the top slot past the highest real speed
1527
+ //0 is the dial's floor (paired with off), never sent as a real speed - Auto sits at the top slot past the highest real speed
1575
1528
  const maxValue = supportsAutomaticFanSpeed ? numberOfFanSpeeds + 1 : numberOfFanSpeeds;
1576
1529
  //if the device somehow reports Auto (0) while not actually supporting it, fall through to the normal clamp (never display 0, that's reserved for off)
1577
1530
  const isAuto = setFanSpeed === 0 && supportsAutomaticFanSpeed;