homebridge-melcloud-control 4.0.0-beta.523 → 4.0.0-beta.525
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/index.js +1 -1
- package/package.json +1 -1
- package/src/deviceata.js +2 -13
- package/src/deviceatw.js +104 -115
- package/src/deviceerv.js +41 -56
- package/src/impulsegenerator.js +2 -2
- package/src/melcloudatw.js +2 -1
- package/src/melclouderv.js +2 -1
package/index.js
CHANGED
|
@@ -200,7 +200,7 @@ class MelCloudPlatform {
|
|
|
200
200
|
|
|
201
201
|
//start impulse generators\
|
|
202
202
|
const timmers = accountType === 'melcloudhome' ? [{ name: 'connect', sampling: 900000 }, { name: 'checkDevicesList', sampling: deviceRefreshInterval }] : [{ name: 'checkDevicesList', sampling: refreshInterval }];
|
|
203
|
-
await melCloud.impulseGenerator.state(true, timmers);
|
|
203
|
+
await melCloud.impulseGenerator.state(true, timmers, false);
|
|
204
204
|
await configuredDevice.startStopImpulseGenerator(true, [{ name: 'checkState', sampling: deviceRefreshInterval }]);
|
|
205
205
|
|
|
206
206
|
//stop impulse generator
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"displayName": "MELCloud Control",
|
|
3
3
|
"name": "homebridge-melcloud-control",
|
|
4
|
-
"version": "4.0.0-beta.
|
|
4
|
+
"version": "4.0.0-beta.525",
|
|
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
|
@@ -159,72 +159,61 @@ class DeviceAta extends EventEmitter {
|
|
|
159
159
|
case 'Power':
|
|
160
160
|
deviceData.Device[key] = value;
|
|
161
161
|
effectiveFlags = AirConditioner.EffectiveFlags.Power;
|
|
162
|
-
set = await this.melCloudAta.send(this.accountType, this.displayType, deviceData);
|
|
163
162
|
break;
|
|
164
163
|
case 'OperationMode':
|
|
165
164
|
deviceData.Device[key] = value;
|
|
166
165
|
effectiveFlags = AirConditioner.EffectiveFlags.OperationMode
|
|
167
|
-
set = await this.melCloudAta.send(this.accountType, this.displayType, deviceData);
|
|
168
166
|
break;
|
|
169
167
|
case 'SetTemperature':
|
|
170
168
|
deviceData.Device[key] = value;
|
|
171
169
|
effectiveFlags = AirConditioner.EffectiveFlags.SetTemperature;
|
|
172
|
-
set = await this.melCloudAta.send(this.accountType, this.displayType, deviceData);
|
|
173
170
|
break;
|
|
174
171
|
case 'DefaultCoolingSetTemperature':
|
|
175
172
|
deviceData.Device[key] = value;
|
|
176
173
|
effectiveFlags = AirConditioner.EffectiveFlags.SetTemperature;
|
|
177
|
-
set = await this.melCloudAta.send(this.accountType, this.displayType, deviceData);
|
|
178
174
|
break;
|
|
179
175
|
case 'DefaultHeatingSetTemperature':
|
|
180
176
|
deviceData.Device[key] = value;
|
|
181
177
|
effectiveFlags = AirConditioner.EffectiveFlags.SetTemperature;
|
|
182
|
-
set = await this.melCloudAta.send(this.accountType, this.displayType, deviceData);
|
|
183
178
|
break;
|
|
184
179
|
case 'FanSpeed':
|
|
185
180
|
deviceData.Device[key] = value;
|
|
186
181
|
effectiveFlags = AirConditioner.EffectiveFlags.SetFanSpeed;
|
|
187
|
-
set = await this.melCloudAta.send(this.accountType, this.displayType, deviceData);
|
|
188
182
|
break;
|
|
189
183
|
case 'VaneHorizontalDirection':
|
|
190
184
|
deviceData.Device[key] = value;
|
|
191
185
|
effectiveFlags = AirConditioner.EffectiveFlags.VaneHorizontalDirection;
|
|
192
|
-
set = await this.melCloudAta.send(this.accountType, this.displayType, deviceData);
|
|
193
186
|
break;
|
|
194
187
|
case 'VaneVerticalDirection':
|
|
195
188
|
deviceData.Device[key] = value;
|
|
196
189
|
effectiveFlags = AirConditioner.EffectiveFlags.VaneVerticalDirection;
|
|
197
|
-
set = await this.melCloudAta.send(this.accountType, this.displayType, deviceData);
|
|
198
190
|
break;
|
|
199
191
|
case 'HideVaneControls':
|
|
200
192
|
deviceData[key] = value;
|
|
201
193
|
effectiveFlags = AirConditioner.EffectiveFlags.Prohibit;
|
|
202
|
-
set = await this.melCloudAta.send(this.accountType, this.displayType, deviceData);
|
|
203
194
|
break;
|
|
204
195
|
case 'HideDryModeControl':
|
|
205
196
|
deviceData[key] = value;
|
|
206
197
|
effectiveFlags = AirConditioner.EffectiveFlags.Prohibit;
|
|
207
|
-
await this.melCloudAta.send(this.accountType, this.displayType, deviceData);
|
|
208
198
|
break;
|
|
209
199
|
case 'ProhibitSetTemperature':
|
|
210
200
|
deviceData.Device[key] = value;
|
|
211
201
|
effectiveFlags = AirConditioner.EffectiveFlags.Prohibit;
|
|
212
|
-
set = await this.melCloudAta.send(this.accountType, this.displayType, deviceData);
|
|
213
202
|
break;
|
|
214
203
|
case 'ProhibitOperationMode':
|
|
215
204
|
deviceData.Device[key] = value;
|
|
216
205
|
effectiveFlags = AirConditioner.EffectiveFlags.Prohibit;
|
|
217
|
-
await this.melCloudAta.send(this.accountType, this.displayType, deviceData);
|
|
218
206
|
break;
|
|
219
207
|
case 'ProhibitPower':
|
|
220
208
|
deviceData.Device[key] = value;
|
|
221
209
|
effectiveFlags = AirConditioner.EffectiveFlags.Prohibit;
|
|
222
|
-
set = await this.melCloudAta.send(this.accountType, this.displayType, deviceData, effectiveFlags);
|
|
223
210
|
break;
|
|
224
211
|
default:
|
|
225
212
|
this.emit('warn', `${integration}, received key: ${key}, value: ${value}`);
|
|
226
213
|
break;
|
|
227
214
|
};
|
|
215
|
+
|
|
216
|
+
set = await this.melCloudAta.send(this.accountType, this.displayType, deviceData, effectiveFlags);
|
|
228
217
|
return set;
|
|
229
218
|
} catch (error) {
|
|
230
219
|
throw new Error(`${integration} set key: ${key}, value: ${value}, error: ${error.message ?? error}`);
|
package/src/deviceatw.js
CHANGED
|
@@ -159,96 +159,82 @@ class DeviceAtw extends EventEmitter {
|
|
|
159
159
|
async setOverExternalIntegration(integration, deviceData, key, value) {
|
|
160
160
|
try {
|
|
161
161
|
let set = false
|
|
162
|
+
let effectiveFlags = null;
|
|
162
163
|
switch (key) {
|
|
163
164
|
case 'Power':
|
|
164
165
|
deviceData.Device[key] = value;
|
|
165
|
-
|
|
166
|
-
set = await this.melCloudAtw.send(this.accountType, this.displayType, deviceData);
|
|
166
|
+
effectiveFlags = HeatPump.EffectiveFlags.Power;
|
|
167
167
|
break;
|
|
168
168
|
case 'OperationMode':
|
|
169
169
|
deviceData.Device[key] = value;
|
|
170
|
-
|
|
171
|
-
set = await this.melCloudAtw.send(this.accountType, this.displayType, deviceData);
|
|
170
|
+
effectiveFlags = HeatPump.EffectiveFlags.OperationMode;
|
|
172
171
|
break;
|
|
173
172
|
case 'OperationModeZone1':
|
|
174
173
|
deviceData.Device[key] = value;
|
|
175
|
-
|
|
176
|
-
set = await this.melCloudAtw.send(this.accountType, this.displayType, deviceData);
|
|
174
|
+
effectiveFlags = HeatPump.EffectiveFlags.OperationModeZone1;
|
|
177
175
|
break;
|
|
178
176
|
case 'OperationModeZone2':
|
|
179
177
|
deviceData.Device[key] = value;
|
|
180
|
-
|
|
181
|
-
set = await this.melCloudAtw.send(this.accountType, this.displayType, deviceData);
|
|
178
|
+
effectiveFlags = HeatPump.EffectiveFlags.OperationModeZone2;
|
|
182
179
|
break;
|
|
183
180
|
case 'SetTemperatureZone1':
|
|
184
181
|
deviceData.Device[key] = value;
|
|
185
|
-
|
|
186
|
-
set = await this.melCloudAtw.send(this.accountType, this.displayType, deviceData);
|
|
182
|
+
effectiveFlags = HeatPump.EffectiveFlags.SetTemperatureZone2;
|
|
187
183
|
break;
|
|
188
184
|
case 'SetTemperatureZone2':
|
|
189
185
|
deviceData.Device[key] = value;
|
|
190
|
-
|
|
191
|
-
set = await this.melCloudAtw.send(this.accountType, this.displayType, deviceData);
|
|
186
|
+
effectiveFlags = HeatPump.EffectiveFlags.SetTemperatureZone2;
|
|
192
187
|
break;
|
|
193
188
|
case 'SetHeatFlowTemperatureZone1':
|
|
194
189
|
deviceData.Device[key] = value;
|
|
195
|
-
|
|
196
|
-
set = await this.melCloudAtw.send(this.accountType, this.displayType, deviceData);
|
|
190
|
+
effectiveFlags = HeatPump.EffectiveFlags.SetHeatFlowTemperatureZone1;
|
|
197
191
|
break;
|
|
198
192
|
case 'SetHeatFlowTemperatureZone2':
|
|
199
193
|
deviceData.Device[key] = value;
|
|
200
|
-
|
|
201
|
-
set = await this.melCloudAtw.send(this.accountType, this.displayType, deviceData);
|
|
194
|
+
effectiveFlags = HeatPump.EffectiveFlags.SetHeatFlowTemperatureZone2;
|
|
202
195
|
break;
|
|
203
196
|
case 'SetCoolFlowTemperatureZone1':
|
|
204
197
|
deviceData.Device[key] = value;
|
|
205
|
-
|
|
206
|
-
set = await this.melCloudAtw.send(this.accountType, this.displayType, deviceData);
|
|
198
|
+
effectiveFlags = HeatPump.EffectiveFlags.SetCoolFlowTemperatureZone1;
|
|
207
199
|
break;
|
|
208
200
|
case 'SetCoolFlowTemperatureZone2':
|
|
209
201
|
deviceData.Device[key] = value;
|
|
210
|
-
|
|
211
|
-
set = await this.melCloudAtw.send(this.accountType, this.displayType, deviceData);
|
|
202
|
+
effectiveFlags = HeatPump.EffectiveFlags.SetCoolFlowTemperatureZone2;
|
|
212
203
|
break;
|
|
213
204
|
case 'SetTankWaterTemperature':
|
|
214
205
|
deviceData.Device[key] = value;
|
|
215
|
-
|
|
216
|
-
set = await this.melCloudAtw.send(this.accountType, this.displayType, deviceData);
|
|
206
|
+
effectiveFlags = HeatPump.EffectiveFlags.SetTankWaterTemperature;
|
|
217
207
|
break;
|
|
218
208
|
case 'ForcedHotWaterMode':
|
|
219
209
|
deviceData.Device[key] = value;
|
|
220
|
-
|
|
221
|
-
set = await this.melCloudAtw.send(this.accountType, this.displayType, deviceData);
|
|
210
|
+
effectiveFlags = HeatPump.EffectiveFlags.ForcedHotWaterMode;
|
|
222
211
|
break;
|
|
223
212
|
case 'EcoHotWater':
|
|
224
213
|
deviceData.Device[key] = value;
|
|
225
|
-
|
|
226
|
-
set = await this.melCloudAtw.send(this.accountType, this.displayType, deviceData);
|
|
214
|
+
effectiveFlags = HeatPump.EffectiveFlags.EcoHotWater;
|
|
227
215
|
break;
|
|
228
216
|
case 'HolidayMode':
|
|
229
217
|
deviceData.Device[key] = value;
|
|
230
|
-
|
|
231
|
-
set = await this.melCloudAtw.send(this.accountType, this.displayType, deviceData);
|
|
218
|
+
effectiveFlags = HeatPump.EffectiveFlags.HolidayMode;
|
|
232
219
|
break;
|
|
233
220
|
case 'ProhibitZone1':
|
|
234
221
|
deviceData.Device[key] = value;
|
|
235
|
-
|
|
236
|
-
set = await this.melCloudAtw.send(this.accountType, this.displayType, deviceData);
|
|
222
|
+
effectiveFlags = HeatPump.EffectiveFlags.ProhibitZone1;
|
|
237
223
|
break;
|
|
238
224
|
case 'ProhibitZone2':
|
|
239
225
|
deviceData.Device[key] = value;
|
|
240
|
-
|
|
241
|
-
set = await this.melCloudAtw.send(this.accountType, this.displayType, deviceData);
|
|
226
|
+
effectiveFlags = HeatPump.EffectiveFlags.ProhibitZone2;
|
|
242
227
|
break;
|
|
243
228
|
case 'ProhibitHotWater':
|
|
244
229
|
deviceData.Device[key] = value;
|
|
245
|
-
|
|
246
|
-
set = await this.melCloudAtw.send(this.accountType, this.displayType, deviceData);
|
|
230
|
+
effectiveFlags = HeatPump.EffectiveFlags.ProhibitHotWater;
|
|
247
231
|
break;
|
|
248
232
|
default:
|
|
249
233
|
this.emit('warn', `${integration}, received key: ${key}, value: ${value}`);
|
|
250
234
|
break;
|
|
251
235
|
};
|
|
236
|
+
|
|
237
|
+
set = await this.melCloudAtw.send(this.accountType, this.displayType, deviceData, effectiveFlags);
|
|
252
238
|
return set;
|
|
253
239
|
} catch (error) {
|
|
254
240
|
throw new Error(`${integration} set key: ${key}, value: ${value}, error: ${error.message ?? error}`);
|
|
@@ -324,8 +310,7 @@ class DeviceAtw extends EventEmitter {
|
|
|
324
310
|
switch (i) {
|
|
325
311
|
case 0: //Heat Pump
|
|
326
312
|
deviceData.Device.Power = [false, true][state];
|
|
327
|
-
|
|
328
|
-
await this.melCloudAtw.send(this.accountType, this.displayType, deviceData);
|
|
313
|
+
await this.melCloudAtw.send(this.accountType, this.displayType, deviceData, HeatPump.EffectiveFlags.Power);
|
|
329
314
|
if (this.logInfo) this.emit('info', `${zoneName}, Set power: ${state ? 'ON' : 'OFF'}`);
|
|
330
315
|
break;
|
|
331
316
|
};
|
|
@@ -351,22 +336,23 @@ class DeviceAtw extends EventEmitter {
|
|
|
351
336
|
.onSet(async (value) => {
|
|
352
337
|
try {
|
|
353
338
|
let operationModeText = '';
|
|
339
|
+
let effectiveFlags = null;
|
|
354
340
|
switch (i) {
|
|
355
341
|
case caseHeatPump: //Heat Pump - ON, HEAT, COOL
|
|
356
342
|
switch (value) {
|
|
357
343
|
case caseHeatPump: //AUTO
|
|
358
344
|
deviceData.Device.Power = true;
|
|
359
|
-
|
|
345
|
+
effectiveFlags = HeatPump.EffectiveFlags.Power;
|
|
360
346
|
break;
|
|
361
347
|
case 1: //HEAT
|
|
362
348
|
deviceData.Device.Power = true;
|
|
363
349
|
deviceData.Device.UnitStatus = 0;
|
|
364
|
-
|
|
350
|
+
effectiveFlags = HeatPump.EffectiveFlags.Power + HeatPump.EffectiveFlags.OperationMode;
|
|
365
351
|
break;
|
|
366
352
|
case 2: //COOL
|
|
367
353
|
deviceData.Device.Power = true;
|
|
368
354
|
deviceData.Device.UnitStatus = 1;
|
|
369
|
-
|
|
355
|
+
effectiveFlags = HeatPump.EffectiveFlags.Power + HeatPump.EffectiveFlags.OperationMode;
|
|
370
356
|
break;
|
|
371
357
|
};
|
|
372
358
|
operationModeText = [HeatPump.System[0], HeatPump.System[deviceData.Device.UnitStatus]][this.accessory.power];
|
|
@@ -375,15 +361,15 @@ class DeviceAtw extends EventEmitter {
|
|
|
375
361
|
switch (value) {
|
|
376
362
|
case 0: //AUTO - HEAT CURVE
|
|
377
363
|
deviceData.Device.OperationModeZone1 = 2;
|
|
378
|
-
|
|
364
|
+
effectiveFlags = HeatPump.EffectiveFlags.OperationModeZone1;
|
|
379
365
|
break;
|
|
380
366
|
case 1: //HEAT - HEAT THERMOSTAT / COOL THERMOSTAT
|
|
381
367
|
deviceData.Device.OperationModeZone1 = [0, 3][this.unitStatus];
|
|
382
|
-
|
|
368
|
+
effectiveFlags = HeatPump.EffectiveFlags.OperationModeZone1;
|
|
383
369
|
break;
|
|
384
370
|
case 2: //COOL - HEAT FLOW / COOL FLOW
|
|
385
371
|
deviceData.Device.OperationModeZone1 = [1, 4][this.unitStatus];
|
|
386
|
-
|
|
372
|
+
effectiveFlags = HeatPump.EffectiveFlags.OperationModeZone1;
|
|
387
373
|
break;
|
|
388
374
|
};
|
|
389
375
|
operationModeText = HeatPump.ZoneOperation[deviceData.Device.OperationModeZone1];
|
|
@@ -392,15 +378,15 @@ class DeviceAtw extends EventEmitter {
|
|
|
392
378
|
switch (value) {
|
|
393
379
|
case 0: //AUTO
|
|
394
380
|
deviceData.Device.ForcedHotWaterMode = false;
|
|
395
|
-
|
|
381
|
+
effectiveFlags = HeatPump.EffectiveFlags.ForcedHotWaterMode;
|
|
396
382
|
break;
|
|
397
383
|
case 1: //HEAT
|
|
398
384
|
deviceData.Device.ForcedHotWaterMode = true;
|
|
399
|
-
|
|
385
|
+
effectiveFlags = HeatPump.EffectiveFlags.ForcedHotWaterMode;
|
|
400
386
|
break;
|
|
401
387
|
case 2: //COOL
|
|
402
388
|
deviceData.Device.ForcedHotWaterMode = false;
|
|
403
|
-
|
|
389
|
+
effectiveFlags = HeatPump.EffectiveFlags.ForcedHotWaterMode;
|
|
404
390
|
break
|
|
405
391
|
};
|
|
406
392
|
operationModeText = deviceData.Device.OperationMode === 1 ? HeatPump.ForceDhw[1] : HeatPump.ForceDhw[deviceData.Device.ForcedHotWaterMode ? 1 : 0];
|
|
@@ -409,22 +395,22 @@ class DeviceAtw extends EventEmitter {
|
|
|
409
395
|
switch (value) {
|
|
410
396
|
case 0: //AUTO
|
|
411
397
|
deviceData.Device.OperationModeZone2 = 2;
|
|
412
|
-
|
|
398
|
+
effectiveFlags = HeatPump.EffectiveFlags.OperationModeZone2;
|
|
413
399
|
break;
|
|
414
400
|
case 1: //HEAT - HEAT THERMOSTAT / COOL THERMOSTAT
|
|
415
401
|
deviceData.Device.OperationModeZone2 = [0, 3][this.unitStatus];
|
|
416
|
-
|
|
402
|
+
effectiveFlags = HeatPump.EffectiveFlags.OperationModeZone2;
|
|
417
403
|
break;
|
|
418
404
|
case 2: //COOL - HEAT FLOW / COOL FLOW
|
|
419
405
|
deviceData.Device.OperationModeZone2 = [1, 4][this.unitStatus];
|
|
420
|
-
|
|
406
|
+
effectiveFlags = HeatPump.EffectiveFlags.OperationModeZone2;
|
|
421
407
|
break;
|
|
422
408
|
};
|
|
423
409
|
operationModeText = HeatPump.ZoneOperation[deviceData.Device.OperationModeZone2];
|
|
424
410
|
break;
|
|
425
411
|
};
|
|
426
412
|
|
|
427
|
-
await this.melCloudAtw.send(this.accountType, this.displayType, deviceData);
|
|
413
|
+
await this.melCloudAtw.send(this.accountType, this.displayType, deviceData, effectiveFlags);
|
|
428
414
|
if (this.logInfo) this.emit('info', `${zoneName}, Set operation mode: ${operationModeText}`);
|
|
429
415
|
} catch (error) {
|
|
430
416
|
if (this.logWarn) this.emit('warn', `${zoneName}, Set operation mode error: ${error}`);
|
|
@@ -454,50 +440,51 @@ class DeviceAtw extends EventEmitter {
|
|
|
454
440
|
})
|
|
455
441
|
.onSet(async (value) => {
|
|
456
442
|
try {
|
|
443
|
+
let effectiveFlags = null;
|
|
457
444
|
switch (i) {
|
|
458
445
|
case caseHeatPump: //Heat Pump
|
|
459
446
|
//deviceData.Device.SetTemperatureZone1 = value;
|
|
460
|
-
//
|
|
447
|
+
//effectiveFlags = CONSTANTS.HeatPump.EffectiveFlags.SetTemperatureZone1;
|
|
461
448
|
break;
|
|
462
449
|
case caseZone1: //Zone 1
|
|
463
450
|
switch (zone.operationMode) {
|
|
464
451
|
case 1: //HEAT FLOW
|
|
465
452
|
deviceData.Device.SetHeatFlowTemperatureZone1 = value;
|
|
466
|
-
|
|
453
|
+
effectiveFlags = HeatPump.EffectiveFlags.SetHeatFlowTemperatureZone1;
|
|
467
454
|
break;
|
|
468
455
|
case 4: //COOL FLOW
|
|
469
456
|
deviceData.Device.SetCoolFlowTemperatureZone1 = value;
|
|
470
|
-
|
|
457
|
+
effectiveFlags = HeatPump.EffectiveFlags.SetCoolFlowTemperatureZone1;
|
|
471
458
|
break;
|
|
472
459
|
default:
|
|
473
460
|
deviceData.Device.SetTemperatureZone1 = value;
|
|
474
|
-
|
|
461
|
+
effectiveFlags = HeatPump.EffectiveFlags.SetTemperatureZone1;
|
|
475
462
|
break
|
|
476
463
|
};
|
|
477
464
|
break;
|
|
478
465
|
case caseHotWater: //Hot Water
|
|
479
466
|
deviceData.Device.SetTankWaterTemperature = value;
|
|
480
|
-
|
|
467
|
+
effectiveFlags = HeatPump.EffectiveFlags.SetTankWaterTemperature;
|
|
481
468
|
break;
|
|
482
469
|
case caseZone2: //Zone 2
|
|
483
470
|
switch (zone.operationMode) {
|
|
484
471
|
case 1: //HEAT FLOW
|
|
485
472
|
deviceData.Device.SetHeatFlowTemperatureZone2 = value;
|
|
486
|
-
|
|
473
|
+
effectiveFlags = HeatPump.EffectiveFlags.SetHeatFlowTemperatureZone2;
|
|
487
474
|
break;
|
|
488
475
|
case 4: //COOL FLOW
|
|
489
476
|
deviceData.Device.SetCoolFlowTemperatureZone2 = value;
|
|
490
|
-
|
|
477
|
+
effectiveFlags = HeatPump.EffectiveFlags.SetCoolFlowTemperatureZone2;
|
|
491
478
|
break;
|
|
492
479
|
default:
|
|
493
480
|
deviceData.Device.SetTemperatureZone2 = value;
|
|
494
|
-
|
|
481
|
+
effectiveFlags = HeatPump.EffectiveFlags.SetTemperatureZone2;
|
|
495
482
|
break
|
|
496
483
|
};
|
|
497
484
|
break;
|
|
498
485
|
};
|
|
499
486
|
|
|
500
|
-
const set = i > 0 ? await this.melCloudAtw.send(this.accountType, this.displayType, deviceData) : false;
|
|
487
|
+
const set = i > 0 ? await this.melCloudAtw.send(this.accountType, this.displayType, deviceData, effectiveFlags) : false;
|
|
501
488
|
const info = this.logInfo || i === 0 ? false : this.emit('info', `${zoneName}, Set cooling threshold temperature: ${value}${this.accessory.temperatureUnit}`);
|
|
502
489
|
} catch (error) {
|
|
503
490
|
if (this.logWarn) this.emit('warn', `${zoneName}, Set cooling threshold temperature error: ${error}`);
|
|
@@ -518,50 +505,51 @@ class DeviceAtw extends EventEmitter {
|
|
|
518
505
|
})
|
|
519
506
|
.onSet(async (value) => {
|
|
520
507
|
try {
|
|
508
|
+
let effectiveFlags = null;
|
|
521
509
|
switch (i) {
|
|
522
510
|
case caseHeatPump: //Heat Pump
|
|
523
511
|
//deviceData.Device.SetTemperatureZone1 = value;
|
|
524
|
-
//
|
|
512
|
+
//effectiveFlags = CONSTANTS.HeatPump.EffectiveFlags.SetTemperatureZone1;
|
|
525
513
|
break;
|
|
526
514
|
case caseZone1: //Zone 1
|
|
527
515
|
switch (zone.operationMode) {
|
|
528
516
|
case 1: //HEAT FLOW
|
|
529
517
|
deviceData.Device.SetHeatFlowTemperatureZone1 = value;
|
|
530
|
-
|
|
518
|
+
effectiveFlags = HeatPump.EffectiveFlags.SetHeatFlowTemperatureZone1;
|
|
531
519
|
break;
|
|
532
520
|
case 4: //COOL FLOW
|
|
533
521
|
deviceData.Device.SetCoolFlowTemperatureZone1 = value;
|
|
534
|
-
|
|
522
|
+
effectiveFlags = HeatPump.EffectiveFlags.SetCoolFlowTemperatureZone1;
|
|
535
523
|
break;
|
|
536
524
|
default:
|
|
537
525
|
deviceData.Device.SetTemperatureZone1 = value;
|
|
538
|
-
|
|
526
|
+
effectiveFlags = HeatPump.EffectiveFlags.SetTemperatureZone1;
|
|
539
527
|
break
|
|
540
528
|
};
|
|
541
529
|
break;
|
|
542
530
|
case caseHotWater: //Hot Water
|
|
543
531
|
deviceData.Device.SetTankWaterTemperature = value;
|
|
544
|
-
|
|
532
|
+
effectiveFlags = HeatPump.EffectiveFlags.SetTankWaterTemperature;
|
|
545
533
|
break;
|
|
546
534
|
case caseZone2: //Zone 2
|
|
547
535
|
switch (zone.operationMode) {
|
|
548
536
|
case 1: //HEAT FLOW
|
|
549
537
|
deviceData.Device.SetHeatFlowTemperatureZone2 = value;
|
|
550
|
-
|
|
538
|
+
effectiveFlags = HeatPump.EffectiveFlags.SetHeatFlowTemperatureZone2;
|
|
551
539
|
break;
|
|
552
540
|
case 4: //COOL FLOW
|
|
553
541
|
deviceData.Device.SetCoolFlowTemperatureZone2 = value;
|
|
554
|
-
|
|
542
|
+
effectiveFlags = HeatPump.EffectiveFlags.SetCoolFlowTemperatureZone2;
|
|
555
543
|
break;
|
|
556
544
|
default:
|
|
557
545
|
deviceData.Device.SetTemperatureZone2 = value;
|
|
558
|
-
|
|
546
|
+
effectiveFlags = HeatPump.EffectiveFlags.SetTemperatureZone2;
|
|
559
547
|
break
|
|
560
548
|
};
|
|
561
549
|
break;
|
|
562
550
|
};
|
|
563
551
|
|
|
564
|
-
const set = i > 0 ? await this.melCloudAtw.send(this.accountType, this.displayType, deviceData) : false;
|
|
552
|
+
const set = i > 0 ? await this.melCloudAtw.send(this.accountType, this.displayType, deviceData, effectiveFlags) : false;
|
|
565
553
|
const info = this.logInfo || i === 0 ? false : this.emit('info', `${zoneName}, Set heating threshold temperature: ${value}${this.accessory.temperatureUnit}`);
|
|
566
554
|
} catch (error) {
|
|
567
555
|
if (this.logWarn) this.emit('warn', `${zoneName}, Set heating threshold temperature error: ${error}`);
|
|
@@ -647,26 +635,27 @@ class DeviceAtw extends EventEmitter {
|
|
|
647
635
|
.onSet(async (value) => {
|
|
648
636
|
try {
|
|
649
637
|
let operationModeText = '';
|
|
638
|
+
let effectiveFlags = null;
|
|
650
639
|
switch (i) {
|
|
651
640
|
case caseHeatPump: //Heat Pump - HEAT, COOL
|
|
652
641
|
switch (value) {
|
|
653
642
|
case 0: //OFF
|
|
654
643
|
deviceData.Device.Power = false;
|
|
655
|
-
|
|
644
|
+
effectiveFlags = HeatPump.EffectiveFlags.Power;
|
|
656
645
|
break;
|
|
657
646
|
case 1: //HEAT
|
|
658
647
|
deviceData.Device.Power = true;
|
|
659
648
|
deviceData.Device.UnitStatus = 0;
|
|
660
|
-
|
|
649
|
+
effectiveFlags = HeatPump.EffectiveFlags.Power + HeatPump.EffectiveFlags.OperationMode;
|
|
661
650
|
break;
|
|
662
651
|
case 2: //COOL
|
|
663
652
|
deviceData.Device.Power = true;
|
|
664
653
|
deviceData.Device.UnitStatus = 1;
|
|
665
|
-
|
|
654
|
+
effectiveFlags = HeatPump.EffectiveFlags.Power + HeatPump.EffectiveFlags.OperationMode;
|
|
666
655
|
break;
|
|
667
656
|
case 3: //AUTO
|
|
668
657
|
deviceData.Device.Power = true;
|
|
669
|
-
|
|
658
|
+
effectiveFlags = HeatPump.EffectiveFlags.Power;
|
|
670
659
|
break;
|
|
671
660
|
};
|
|
672
661
|
operationModeText = [HeatPump.System[0], HeatPump.System[deviceData.Device.UnitStatus]][this.accessory.power];
|
|
@@ -675,19 +664,19 @@ class DeviceAtw extends EventEmitter {
|
|
|
675
664
|
switch (value) {
|
|
676
665
|
case 0: //OFF - HEAT CURVE
|
|
677
666
|
deviceData.Device.OperationModeZone1 = 2;
|
|
678
|
-
|
|
667
|
+
effectiveFlags = HeatPump.EffectiveFlags.OperationModeZone1;
|
|
679
668
|
break;
|
|
680
669
|
case 1: //HEAT - HEAT THERMOSTAT / COOL THERMOSTAT
|
|
681
670
|
deviceData.Device.OperationModeZone1 = [0, 3][this.unitStatus];
|
|
682
|
-
|
|
671
|
+
effectiveFlags = HeatPump.EffectiveFlags.OperationModeZone1;
|
|
683
672
|
break;
|
|
684
673
|
case 2: //COOL - HEAT FLOW / COOL FLOW
|
|
685
674
|
deviceData.Device.OperationModeZone1 = [1, 4][this.unitStatus];
|
|
686
|
-
|
|
675
|
+
effectiveFlags = HeatPump.EffectiveFlags.OperationModeZone1;
|
|
687
676
|
break;
|
|
688
677
|
case 3: //AUTO - HEAT CURVE
|
|
689
678
|
deviceData.Device.OperationModeZone1 = 2;
|
|
690
|
-
|
|
679
|
+
effectiveFlags = HeatPump.EffectiveFlags.OperationModeZone1;
|
|
691
680
|
break;
|
|
692
681
|
};
|
|
693
682
|
operationModeText = HeatPump.ZoneOperation[deviceData.Device.OperationModeZone1];
|
|
@@ -696,19 +685,19 @@ class DeviceAtw extends EventEmitter {
|
|
|
696
685
|
switch (value) {
|
|
697
686
|
case 0: //OFF
|
|
698
687
|
deviceData.Device.ForcedHotWaterMode = false;
|
|
699
|
-
|
|
688
|
+
effectiveFlags = HeatPump.EffectiveFlags.ForcedHotWaterMode;
|
|
700
689
|
break;
|
|
701
690
|
case 1: //HEAT
|
|
702
691
|
deviceData.Device.ForcedHotWaterMode = true;
|
|
703
|
-
|
|
692
|
+
effectiveFlags = HeatPump.EffectiveFlags.ForcedHotWaterMode;
|
|
704
693
|
break;
|
|
705
694
|
case 2: //COOL
|
|
706
695
|
deviceData.Device.ForcedHotWaterMode = false;
|
|
707
|
-
|
|
696
|
+
effectiveFlags = HeatPump.EffectiveFlags.ForcedHotWaterMode;
|
|
708
697
|
break;
|
|
709
698
|
case 3: //AUTO
|
|
710
699
|
deviceData.Device.ForcedHotWaterMode = false;
|
|
711
|
-
|
|
700
|
+
effectiveFlags = HeatPump.EffectiveFlags.ForcedHotWaterMode;
|
|
712
701
|
break;
|
|
713
702
|
};
|
|
714
703
|
operationModeText = deviceData.Device.OperationMode === 1 ? HeatPump.ForceDhw[1] : HeatPump.ForceDhw[deviceData.Device.ForcedHotWaterMode ? 1 : 0];
|
|
@@ -717,26 +706,26 @@ class DeviceAtw extends EventEmitter {
|
|
|
717
706
|
switch (value) {
|
|
718
707
|
case 0: //OFF - HEAT CURVE
|
|
719
708
|
deviceData.Device.OperationModeZone2 = 2;
|
|
720
|
-
|
|
709
|
+
effectiveFlags = HeatPump.EffectiveFlags.OperationModeZone2;
|
|
721
710
|
break;
|
|
722
711
|
case 1: //HEAT - HEAT THERMOSTAT / COOL THERMOSTAT
|
|
723
712
|
deviceData.Device.OperationModeZone2 = [0, 3][this.unitStatus];
|
|
724
|
-
|
|
713
|
+
effectiveFlags = HeatPump.EffectiveFlags.OperationModeZone2;
|
|
725
714
|
break;
|
|
726
715
|
case 2: //COOL - HEAT FLOW / COOL FLOW
|
|
727
716
|
deviceData.Device.OperationModeZone2 = [1, 4][this.unitStatus];
|
|
728
|
-
|
|
717
|
+
effectiveFlags = HeatPump.EffectiveFlags.OperationModeZone2;
|
|
729
718
|
break;
|
|
730
719
|
case 3: //AUTO - HEAT CURVE
|
|
731
720
|
deviceData.Device.OperationModeZone2 = 2;
|
|
732
|
-
|
|
721
|
+
effectiveFlags = HeatPump.EffectiveFlags.OperationModeZone2;
|
|
733
722
|
break;
|
|
734
723
|
};
|
|
735
724
|
operationModeText = HeatPump.ZoneOperation[deviceData.Device.OperationModeZone2];
|
|
736
725
|
break;
|
|
737
726
|
};
|
|
738
727
|
|
|
739
|
-
await this.melCloudAtw.send(this.accountType, this.displayType, deviceData);
|
|
728
|
+
await this.melCloudAtw.send(this.accountType, this.displayType, deviceData, effectiveFlags);
|
|
740
729
|
if (this.logInfo) this.emit('info', `${zoneName}, Set operation mode: ${operationModeText}`);
|
|
741
730
|
} catch (error) {
|
|
742
731
|
if (this.logWarn) this.emit('warn', `${zoneName}, Set operation mode error: ${error}`);
|
|
@@ -764,27 +753,28 @@ class DeviceAtw extends EventEmitter {
|
|
|
764
753
|
})
|
|
765
754
|
.onSet(async (value) => {
|
|
766
755
|
try {
|
|
756
|
+
let effectiveFlags = null;
|
|
767
757
|
switch (i) {
|
|
768
758
|
case caseHeatPump: //Heat Pump
|
|
769
759
|
//deviceData.Device.SetTemperatureZone1 = value;
|
|
770
|
-
//
|
|
760
|
+
//effectiveFlags = CONSTANTS.HeatPump.EffectiveFlags.SetTemperatureZone1;
|
|
771
761
|
break;
|
|
772
762
|
case caseZone1: //Zone 1
|
|
773
763
|
deviceData.Device.SetTemperatureZone1 = value;
|
|
774
|
-
|
|
764
|
+
effectiveFlags = HeatPump.EffectiveFlags.SetTemperatureZone1;
|
|
775
765
|
break;
|
|
776
766
|
case caseHotWater: //Hot Water
|
|
777
767
|
deviceData.Device.SetTankWaterTemperature = value;
|
|
778
|
-
|
|
768
|
+
effectiveFlags = HeatPump.EffectiveFlags.SetTankWaterTemperature;
|
|
779
769
|
break;
|
|
780
770
|
case caseZone2: //Zone 2
|
|
781
771
|
deviceData.Device.SetTemperatureZone2 = value;
|
|
782
|
-
|
|
772
|
+
effectiveFlags = HeatPump.EffectiveFlags.SetTemperatureZone2;
|
|
783
773
|
break;
|
|
784
774
|
};
|
|
785
775
|
|
|
786
|
-
|
|
787
|
-
|
|
776
|
+
if (i > 0) await this.melCloudAtw.send(this.accountType, this.displayType, deviceData, effectiveFlags);
|
|
777
|
+
if (this.logInfo && i !== 0) this.emit('info', `${zoneName}, Set temperature: ${value}${this.accessory.temperatureUnit}`);
|
|
788
778
|
} catch (error) {
|
|
789
779
|
if (this.logWarn) this.emit('warn', `${zoneName}, Set temperature error: ${error}`);
|
|
790
780
|
};
|
|
@@ -1085,7 +1075,6 @@ class DeviceAtw extends EventEmitter {
|
|
|
1085
1075
|
deviceData.Device.SetHeatFlowTemperatureZone2 = presetData.SetHeatFlowTemperatureZone2;
|
|
1086
1076
|
deviceData.Device.SetCoolFlowTemperatureZone1 = presetData.SetCoolFlowTemperatureZone1;
|
|
1087
1077
|
deviceData.Device.SetCoolFlowTemperatureZone2 = presetData.SetCoolFlowTemperatureZone2;
|
|
1088
|
-
deviceData.Device.EffectiveFlags = HeatPump.EffectiveFlags.Power;
|
|
1089
1078
|
break;
|
|
1090
1079
|
case false:
|
|
1091
1080
|
deviceData.Device.Power = preset.previousSettings.Power;
|
|
@@ -1100,11 +1089,10 @@ class DeviceAtw extends EventEmitter {
|
|
|
1100
1089
|
deviceData.Device.SetHeatFlowTemperatureZone2 = preset.previousSettings.SetHeatFlowTemperatureZone2;
|
|
1101
1090
|
deviceData.Device.SetCoolFlowTemperatureZone1 = preset.previousSettings.SetCoolFlowTemperatureZone1;
|
|
1102
1091
|
deviceData.Device.SetCoolFlowTemperatureZone2 = preset.previousSettings.SetCoolFlowTemperatureZone2;
|
|
1103
|
-
deviceData.Device.EffectiveFlags = HeatPump.EffectiveFlags.Power;
|
|
1104
1092
|
break;
|
|
1105
1093
|
};
|
|
1106
1094
|
|
|
1107
|
-
await this.melCloudAtw.send(this.accountType, this.displayType, deviceData);
|
|
1095
|
+
await this.melCloudAtw.send(this.accountType, this.displayType, deviceData, HeatPump.EffectiveFlags.Power);
|
|
1108
1096
|
if (this.logInfo) this.emit('info', `${state ? 'Set:' : 'Unset:'} ${name}`);
|
|
1109
1097
|
} catch (error) {
|
|
1110
1098
|
if (this.logWarn) this.emit('warn', `Set preset error: ${error}`);
|
|
@@ -1146,122 +1134,123 @@ class DeviceAtw extends EventEmitter {
|
|
|
1146
1134
|
.onSet(async (state) => {
|
|
1147
1135
|
if (displayType > 0 && displayType < 3) {
|
|
1148
1136
|
try {
|
|
1137
|
+
let effectiveFlags = null;
|
|
1149
1138
|
switch (mode) {
|
|
1150
1139
|
case 0: //POWER ON,OFF
|
|
1151
1140
|
deviceData.Device.Power = state;
|
|
1152
|
-
|
|
1141
|
+
effectiveFlags = HeatPump.EffectiveFlags.Power;
|
|
1153
1142
|
break;
|
|
1154
1143
|
case 1: //HEAT PUMP HEAT
|
|
1155
1144
|
button.previousValue = state ? deviceData.Device.UnitStatus : button.previousValue ?? deviceData.Device.UnitStatus;
|
|
1156
1145
|
deviceData.Device.Power = true;
|
|
1157
1146
|
deviceData.Device.UnitStatus = state ? 0 : button.previousValue;
|
|
1158
|
-
|
|
1147
|
+
effectiveFlags = HeatPump.EffectiveFlags.Power + HeatPump.EffectiveFlags.OperationMode;
|
|
1159
1148
|
break;
|
|
1160
1149
|
case 2: //COOL
|
|
1161
1150
|
button.previousValue = state ? deviceData.Device.UnitStatus : button.previousValue ?? deviceData.Device.UnitStatus;
|
|
1162
1151
|
deviceData.Device.Power = true;
|
|
1163
1152
|
deviceData.Device.UnitStatus = state ? 1 : button.previousValue;
|
|
1164
|
-
|
|
1153
|
+
effectiveFlags = HeatPump.EffectiveFlags.Power + HeatPump.EffectiveFlags.OperationMode;
|
|
1165
1154
|
break;
|
|
1166
1155
|
case 3: //HOLIDAY
|
|
1167
1156
|
deviceData.Device.HolidayMode = state;
|
|
1168
|
-
|
|
1157
|
+
effectiveFlags = HeatPump.EffectiveFlags.HolidayMode;
|
|
1169
1158
|
break;
|
|
1170
1159
|
case 10: //ALL ZONES PHYSICAL LOCK CONTROL
|
|
1171
1160
|
deviceData.Device.ProhibitZone1 = state;
|
|
1172
1161
|
deviceData.Device.ProhibitHotWater = state;
|
|
1173
1162
|
deviceData.Device.ProhibitZone2 = state;
|
|
1174
|
-
|
|
1163
|
+
effectiveFlags = HeatPump.EffectiveFlags.ProhibitHeatingZone1 + HeatPump.EffectiveFlags.ProhibitHotWater + HeatPump.EffectiveFlags.ProhibitHeatingZone2;
|
|
1175
1164
|
break;
|
|
1176
1165
|
case 20: //ZONE 1 HEAT THERMOSTAT
|
|
1177
1166
|
button.previousValue = state ? deviceData.Device.OperationModeZone1 : button.previousValue ?? deviceData.Device.OperationModeZone1;
|
|
1178
1167
|
deviceData.Device.Power = true;
|
|
1179
1168
|
deviceData.Device.OperationModeZone1 = state ? 0 : button.previousValue;
|
|
1180
|
-
|
|
1169
|
+
effectiveFlags = HeatPump.EffectiveFlags.Power + HeatPump.EffectiveFlags.OperationModeZone1;
|
|
1181
1170
|
break;
|
|
1182
1171
|
case 21: //HEAT FLOW
|
|
1183
1172
|
button.previousValue = state ? deviceData.Device.OperationModeZone1 : button.previousValue ?? deviceData.Device.OperationModeZone1;
|
|
1184
1173
|
deviceData.Device.Power = true;
|
|
1185
1174
|
deviceData.Device.OperationModeZone1 = state ? 1 : button.previousValue;
|
|
1186
|
-
|
|
1175
|
+
effectiveFlags = HeatPump.EffectiveFlags.Power + HeatPump.EffectiveFlags.OperationModeZone1;
|
|
1187
1176
|
break;
|
|
1188
1177
|
case 22: //HEAT CURVE
|
|
1189
1178
|
button.previousValue = state ? deviceData.Device.OperationModeZone1 : button.previousValue ?? deviceData.Device.OperationModeZone1;
|
|
1190
1179
|
deviceData.Device.Power = true;
|
|
1191
1180
|
deviceData.Device.OperationModeZone1 = state ? 2 : button.previousValue;
|
|
1192
|
-
|
|
1181
|
+
effectiveFlags = HeatPump.EffectiveFlags.Power + HeatPump.EffectiveFlags.OperationModeZone1;
|
|
1193
1182
|
break;
|
|
1194
1183
|
case 23: //COOL THERMOSTAT
|
|
1195
1184
|
button.previousValue = state ? deviceData.Device.OperationModeZone1 : button.previousValue ?? deviceData.Device.OperationModeZone1;
|
|
1196
1185
|
deviceData.Device.Power = true;
|
|
1197
1186
|
deviceData.Device.OperationModeZone1 = state ? 3 : button.previousValue;
|
|
1198
|
-
|
|
1187
|
+
effectiveFlags = HeatPump.EffectiveFlags.Power + HeatPump.EffectiveFlags.OperationModeZone1;
|
|
1199
1188
|
break;
|
|
1200
1189
|
case 24: //COOL FLOW
|
|
1201
1190
|
button.previousValue = state ? deviceData.Device.OperationModeZone1 : button.previousValue ?? deviceData.Device.OperationModeZone1;
|
|
1202
1191
|
deviceData.Device.Power = true;
|
|
1203
1192
|
deviceData.Device.OperationModeZone1 = state ? 4 : button.previousValue;
|
|
1204
|
-
|
|
1193
|
+
effectiveFlags = HeatPump.EffectiveFlags.Power + HeatPump.EffectiveFlags.OperationModeZone1;
|
|
1205
1194
|
break;
|
|
1206
1195
|
case 25: //FLOOR DRY UP
|
|
1207
1196
|
button.previousValue = state ? deviceData.Device.OperationModeZone1 : button.previousValue ?? deviceData.Device.OperationModeZone1;
|
|
1208
1197
|
deviceData.Device.Power = true;
|
|
1209
1198
|
deviceData.Device.OperationModeZone1 = state ? 5 : button.previousValue;
|
|
1210
|
-
|
|
1199
|
+
effectiveFlags = HeatPump.EffectiveFlags.Power + HeatPump.EffectiveFlags.OperationModeZone1;
|
|
1211
1200
|
break;
|
|
1212
1201
|
case 30: //PHYSICAL LOCK CONTROL
|
|
1213
1202
|
deviceData.Device.ProhibitZone1 = state;
|
|
1214
|
-
HeatPump.EffectiveFlags.ProhibitHeatingZone1;
|
|
1203
|
+
effectiveFlags = HeatPump.EffectiveFlags.ProhibitHeatingZone1;
|
|
1215
1204
|
break;
|
|
1216
1205
|
case 40: //HOT WATER NORMAL/FORCE HOT WATER
|
|
1217
1206
|
deviceData.Device.Power = true;
|
|
1218
1207
|
deviceData.Device.ForcedHotWaterMode = state;
|
|
1219
|
-
|
|
1208
|
+
effectiveFlags = HeatPump.EffectiveFlags.Power + HeatPump.EffectiveFlags.ForcedHotWaterMode;
|
|
1220
1209
|
break;
|
|
1221
1210
|
case 41: //NORMAL/ECO
|
|
1222
1211
|
deviceData.Device.Power = true;
|
|
1223
1212
|
deviceData.Device.EcoHotWater = state;
|
|
1224
|
-
|
|
1213
|
+
effectiveFlags = HeatPump.EffectiveFlags.Power + HeatPump.EffectiveFlags.EcoHotWater;
|
|
1225
1214
|
break;
|
|
1226
1215
|
case 50: //PHYSICAL LOCK CONTROL
|
|
1227
1216
|
deviceData.Device.ProhibitHotWater = state;
|
|
1228
|
-
HeatPump.EffectiveFlags.ProhibitHotWater;
|
|
1217
|
+
effectiveFlags = HeatPump.EffectiveFlags.ProhibitHotWater;
|
|
1229
1218
|
break;
|
|
1230
1219
|
case 60: //ZONE 2 HEAT THERMOSTAT
|
|
1231
1220
|
button.previousValue = state ? deviceData.Device.OperationModeZone2 : button.previousValue ?? deviceData.Device.OperationModeZone2;
|
|
1232
1221
|
deviceData.Device.Power = true;
|
|
1233
1222
|
deviceData.Device.OperationModeZone2 = state ? 0 : button.previousValue;
|
|
1234
|
-
|
|
1223
|
+
effectiveFlags = HeatPump.EffectiveFlags.Power + HeatPump.EffectiveFlags.OperationModeZone2;
|
|
1235
1224
|
break;
|
|
1236
1225
|
case 61: // HEAT FLOW
|
|
1237
1226
|
button.previousValue = state ? deviceData.Device.OperationModeZone2 : button.previousValue ?? deviceData.Device.OperationModeZone2;
|
|
1238
1227
|
deviceData.Device.Power = true;
|
|
1239
1228
|
deviceData.Device.OperationModeZone2 = state ? 1 : button.previousValue;
|
|
1240
|
-
|
|
1229
|
+
effectiveFlags = HeatPump.EffectiveFlags.Power + HeatPump.EffectiveFlags.OperationModeZone2;
|
|
1241
1230
|
break;
|
|
1242
1231
|
case 62: //HEAT CURVE
|
|
1243
1232
|
button.previousValue = state ? deviceData.Device.OperationModeZone2 : button.previousValue ?? deviceData.Device.OperationModeZone2;
|
|
1244
1233
|
deviceData.Device.Power = true;
|
|
1245
1234
|
deviceData.Device.OperationModeZone2 = state ? 2 : button.previousValue;
|
|
1246
|
-
|
|
1235
|
+
effectiveFlags = HeatPump.EffectiveFlags.Power + HeatPump.EffectiveFlags.OperationModeZone2;
|
|
1247
1236
|
break;
|
|
1248
1237
|
case 63: //COOL THERMOSTAT
|
|
1249
1238
|
button.previousValue = state ? deviceData.Device.OperationModeZone2 : button.previousValue ?? deviceData.Device.OperationModeZone2;
|
|
1250
1239
|
deviceData.Device.Power = true;
|
|
1251
1240
|
deviceData.Device.OperationModeZone2 = state ? 3 : button.previousValue;
|
|
1252
|
-
|
|
1241
|
+
effectiveFlags = HeatPump.EffectiveFlags.Power + HeatPump.EffectiveFlags.OperationModeZone2;
|
|
1253
1242
|
break;
|
|
1254
1243
|
case 64: //COOL FLOW
|
|
1255
1244
|
button.previousValue = state ? deviceData.Device.OperationModeZone2 : button.previousValue ?? deviceData.Device.OperationModeZone2;
|
|
1256
1245
|
deviceData.Device.Power = true;
|
|
1257
1246
|
deviceData.Device.OperationModeZone2 = state ? 4 : button.previousValue;
|
|
1258
|
-
|
|
1247
|
+
effectiveFlags = HeatPump.EffectiveFlags.Power + HeatPump.EffectiveFlags.OperationModeZone2;
|
|
1259
1248
|
break;
|
|
1260
1249
|
case 65: //FLOOR DRY UP
|
|
1261
1250
|
button.previousValue = state ? deviceData.Device.OperationModeZone2 : button.previousValue ?? deviceData.Device.OperationModeZone2;
|
|
1262
1251
|
deviceData.Device.Power = true;
|
|
1263
1252
|
deviceData.Device.OperationModeZone2 = state ? 5 : button.previousValue;
|
|
1264
|
-
|
|
1253
|
+
effectiveFlags = HeatPump.EffectiveFlags.Power + HeatPump.EffectiveFlags.OperationModeZone2;
|
|
1265
1254
|
break;
|
|
1266
1255
|
case 70: //PHYSICAL LOCK CONTROL
|
|
1267
1256
|
deviceData.Device.ProhibitZone2 = state;
|
|
@@ -1272,7 +1261,7 @@ class DeviceAtw extends EventEmitter {
|
|
|
1272
1261
|
break;
|
|
1273
1262
|
};
|
|
1274
1263
|
|
|
1275
|
-
await this.melCloudAtw.send(this.accountType, this.displayType, deviceData);
|
|
1264
|
+
await this.melCloudAtw.send(this.accountType, this.displayType, deviceData, effectiveFlags);
|
|
1276
1265
|
if (this.logInfo) this.emit('info', `${state ? `Set: ${name}` : `Unset: ${name}, Set: ${button.previousValue}`}`);
|
|
1277
1266
|
} catch (error) {
|
|
1278
1267
|
if (this.logWarn) this.emit('warn', `Set button error: ${error}`);
|
package/src/deviceerv.js
CHANGED
|
@@ -152,66 +152,58 @@ class DeviceErv extends EventEmitter {
|
|
|
152
152
|
async setOverExternalIntegration(integration, deviceData, key, value) {
|
|
153
153
|
try {
|
|
154
154
|
let set = false
|
|
155
|
+
let effectiveFlags = null;
|
|
155
156
|
switch (key) {
|
|
156
157
|
case 'Power':
|
|
157
158
|
deviceData.Device[key] = value;
|
|
158
|
-
|
|
159
|
-
set = await this.melCloudErv.send(this.accountType, this.displayType, deviceData);
|
|
159
|
+
effectiveFlags = Ventilation.EffectiveFlags.Power;
|
|
160
160
|
break;
|
|
161
161
|
case 'OperationMode':
|
|
162
162
|
deviceData.Device[key] = value;
|
|
163
|
-
|
|
164
|
-
set = await this.melCloudErv.send(this.accountType, this.displayType, deviceData);
|
|
163
|
+
effectiveFlags = Ventilation.EffectiveFlags.OperationMode;
|
|
165
164
|
break;
|
|
166
165
|
case 'VentilationMode':
|
|
167
166
|
deviceData.Device[key] = value;
|
|
168
|
-
|
|
169
|
-
set = await this.melCloudErv.send(this.accountType, this.displayType, deviceData);
|
|
167
|
+
effectiveFlags = Ventilation.EffectiveFlags.VentilationMode;
|
|
170
168
|
break;
|
|
171
169
|
case 'SetTemperature':
|
|
172
170
|
deviceData.Device[key] = value;
|
|
173
|
-
|
|
174
|
-
set = await this.melCloudErv.send(this.accountType, this.displayType, deviceData);
|
|
171
|
+
effectiveFlags = Ventilation.EffectiveFlags.SetTemperature;
|
|
175
172
|
break;
|
|
176
173
|
case 'DefaultCoolingSetTemperature':
|
|
177
174
|
deviceData.Device[key] = value;
|
|
178
|
-
|
|
179
|
-
set = await this.melCloudErv.send(this.accountType, this.displayType, deviceData);
|
|
175
|
+
effectiveFlags = Ventilation.EffectiveFlags.SetTemperature;
|
|
180
176
|
break;
|
|
181
177
|
case 'DefaultHeatingSetTemperature':
|
|
182
178
|
deviceData.Device[key] = value;
|
|
183
|
-
|
|
184
|
-
set = await this.melCloudErv.send(this.accountType, this.displayType, deviceData);
|
|
179
|
+
effectiveFlags = Ventilation.EffectiveFlags.SetTemperature;
|
|
185
180
|
break;
|
|
186
181
|
case 'NightPurgeMode':
|
|
187
182
|
deviceData.Device[key] = value;
|
|
188
|
-
|
|
189
|
-
set = await this.melCloudErv.send(this.accountType, this.displayType, deviceData);
|
|
183
|
+
effectiveFlags = Ventilation.EffectiveFlags.NightPurgeMode;
|
|
190
184
|
break;
|
|
191
185
|
case 'SetFanSpeed':
|
|
192
186
|
deviceData.Device[key] = value;
|
|
193
|
-
|
|
194
|
-
set = await this.melCloudErv.send(this.accountType, this.displayType, deviceData);
|
|
187
|
+
effectiveFlags = Ventilation.EffectiveFlags.SetFanSpeed;
|
|
195
188
|
break;
|
|
196
189
|
case 'HideRoomTemperature':
|
|
197
190
|
deviceData[key] = value;
|
|
198
|
-
|
|
199
|
-
set = await this.melCloudErv.send(this.accountType, this.displayType, deviceData);
|
|
191
|
+
effectiveFlags = Ventilation.EffectiveFlags.Prohibit;
|
|
200
192
|
break;
|
|
201
193
|
case 'HideSupplyTemperature':
|
|
202
194
|
deviceData[key] = value;
|
|
203
|
-
|
|
204
|
-
set = await this.melCloudErv.send(this.accountType, this.displayType, deviceData);
|
|
195
|
+
effectiveFlags = Ventilation.EffectiveFlags.Prohibit;
|
|
205
196
|
break;
|
|
206
197
|
case 'HideOutdoorTemperature':
|
|
207
198
|
deviceData[key] = value;
|
|
208
|
-
|
|
209
|
-
set = await this.melCloudErv.send(this.accountType, this.displayType, deviceData);
|
|
199
|
+
effectiveFlags = Ventilation.EffectiveFlags.Prohibit;
|
|
210
200
|
break;
|
|
211
201
|
default:
|
|
212
202
|
this.emit('warn', `${integration}, received key: ${key}, value: ${value}`);
|
|
213
203
|
break;
|
|
214
204
|
};
|
|
205
|
+
|
|
206
|
+
set = await this.melCloudErv.send(this.accountType, this.displayType, deviceData, effectiveFlags);
|
|
215
207
|
return set;
|
|
216
208
|
} catch (error) {
|
|
217
209
|
throw new Error(`${integration} set key: ${key}, value: ${value}, error: ${error.message ?? error}`);
|
|
@@ -280,8 +272,7 @@ class DeviceErv extends EventEmitter {
|
|
|
280
272
|
.onSet(async (state) => {
|
|
281
273
|
try {
|
|
282
274
|
deviceData.Device.Power = [false, true][state];
|
|
283
|
-
|
|
284
|
-
await this.melCloudErv.send(this.accountType, this.displayType, deviceData);
|
|
275
|
+
await this.melCloudErv.send(this.accountType, this.displayType, deviceData, Ventilation.EffectiveFlags.Power);
|
|
285
276
|
if (this.logInfo) this.emit('info', `Set power: ${state ? 'ON' : 'OFF'}`);
|
|
286
277
|
} catch (error) {
|
|
287
278
|
if (this.logWarn) this.emit('warn', `Set power error: ${error}`);
|
|
@@ -316,8 +307,7 @@ class DeviceErv extends EventEmitter {
|
|
|
316
307
|
break;
|
|
317
308
|
};
|
|
318
309
|
|
|
319
|
-
|
|
320
|
-
await this.melCloudErv.send(this.accountType, this.displayType, deviceData);
|
|
310
|
+
await this.melCloudErv.send(this.accountType, this.displayType, deviceData, Ventilation.EffectiveFlags.VentilationMode);
|
|
321
311
|
const operationModeText = Ventilation.VentilationMode[deviceData.Device.VentilationMode];
|
|
322
312
|
if (this.logInfo) this.emit('info', `Set operation mode: ${operationModeText}`);
|
|
323
313
|
} catch (error) {
|
|
@@ -360,8 +350,7 @@ class DeviceErv extends EventEmitter {
|
|
|
360
350
|
deviceData.Device.SetFanSpeed = hasAutomaticFanSpeed ? [0, 1, 2, 3, 4, 5, 0][value] : [1, 1, 2, 3, 4, 5][value];
|
|
361
351
|
break;;
|
|
362
352
|
};
|
|
363
|
-
|
|
364
|
-
await this.melCloudErv.send(this.accountType, this.displayType, deviceData);
|
|
353
|
+
await this.melCloudErv.send(this.accountType, this.displayType, deviceData, Ventilation.EffectiveFlags.SetFanSpeed);
|
|
365
354
|
if (this.logInfo) this.emit('info', `Set fan speed mode: ${Ventilation.FanSpeed[fanSpeedModeText]}`);
|
|
366
355
|
} catch (error) {
|
|
367
356
|
if (this.logWarn) this.emit('warn', `Set fan speed mode error: ${error}`);
|
|
@@ -382,8 +371,7 @@ class DeviceErv extends EventEmitter {
|
|
|
382
371
|
.onSet(async (value) => {
|
|
383
372
|
try {
|
|
384
373
|
deviceData.Device.DefaultCoolingSetTemperature = value;
|
|
385
|
-
|
|
386
|
-
await this.melCloudErv.send(this.accountType, this.displayType, deviceData);
|
|
374
|
+
await this.melCloudErv.send(this.accountType, this.displayType, deviceData, Ventilation.EffectiveFlags.SetTemperature);
|
|
387
375
|
if (this.logInfo) this.emit('info', `Set cooling threshold temperature: ${value}${this.accessory.temperatureUnit}`);
|
|
388
376
|
} catch (error) {
|
|
389
377
|
if (this.logWarn) this.emit('warn', `Set cooling threshold temperature error: ${error}`);
|
|
@@ -405,8 +393,7 @@ class DeviceErv extends EventEmitter {
|
|
|
405
393
|
.onSet(async (value) => {
|
|
406
394
|
try {
|
|
407
395
|
deviceData.Device.DefaultHeatingSetTemperature = value;
|
|
408
|
-
|
|
409
|
-
await this.melCloudErv.send(this.accountType, this.displayType, deviceData);
|
|
396
|
+
await this.melCloudErv.send(this.accountType, this.displayType, deviceData, Ventilation.EffectiveFlags.SetTemperature);
|
|
410
397
|
if (this.logInfo) this.emit('info', `Set heating threshold temperature: ${value}${this.accessory.temperatureUnit}`);
|
|
411
398
|
} catch (error) {
|
|
412
399
|
if (this.logWarn) this.emit('warn', `Set heating threshold temperature error: ${error}`);
|
|
@@ -423,8 +410,7 @@ class DeviceErv extends EventEmitter {
|
|
|
423
410
|
// try {
|
|
424
411
|
// value = value ? true : false;
|
|
425
412
|
// deviceData.Device = deviceData.Device;
|
|
426
|
-
//
|
|
427
|
-
// await this.melCloudErv.send(this.accountType, this.displayType, deviceData);
|
|
413
|
+
// await this.melCloudErv.send(this.accountType, this.displayType, deviceData, Ventilation.EffectiveFlags.Prohibit);
|
|
428
414
|
// if (this.logInfo) this.emit('info', `Set local physical controls: ${value ? 'LOCK' : 'UNLOCK'}`);
|
|
429
415
|
// } catch (error) {
|
|
430
416
|
// if (this.logWarn) this.emit('warn', `Set lock physical controls error: ${error}`);
|
|
@@ -470,29 +456,30 @@ class DeviceErv extends EventEmitter {
|
|
|
470
456
|
})
|
|
471
457
|
.onSet(async (value) => {
|
|
472
458
|
try {
|
|
459
|
+
let effectiveFlags = null;
|
|
473
460
|
switch (value) {
|
|
474
461
|
case 0: //OFF - POWER OFF
|
|
475
462
|
deviceData.Device.Power = false;
|
|
476
|
-
|
|
463
|
+
effectiveFlags = Ventilation.EffectiveFlags.Power;
|
|
477
464
|
break;
|
|
478
465
|
case 1: //HEAT - LOSSNAY
|
|
479
466
|
deviceData.Device.Power = true;
|
|
480
467
|
deviceData.Device.VentilationMode = 0;
|
|
481
|
-
|
|
468
|
+
effectiveFlags = Ventilation.EffectiveFlags.Power + Ventilation.EffectiveFlags.VentilationMode;
|
|
482
469
|
break;
|
|
483
470
|
case 2: //COOL - BYPASS
|
|
484
471
|
deviceData.Device.Power = true;
|
|
485
472
|
deviceData.Device.VentilationMode = hasBypassVentilationMode ? 1 : 0;
|
|
486
|
-
|
|
473
|
+
effectiveFlags = Ventilation.EffectiveFlags.Power + Ventilation.EffectiveFlags.VentilationMode;
|
|
487
474
|
break;
|
|
488
475
|
case 3: //AUTO - AUTO
|
|
489
476
|
deviceData.Device.Power = true;
|
|
490
477
|
deviceData.Device.VentilationMode = hasAutoVentilationMode ? 2 : 0;
|
|
491
|
-
|
|
478
|
+
effectiveFlags = Ventilation.EffectiveFlags.Power + Ventilation.EffectiveFlags.VentilationMode;
|
|
492
479
|
break;
|
|
493
480
|
};
|
|
494
481
|
|
|
495
|
-
await this.melCloudErv.send(this.accountType, this.displayType, deviceData);
|
|
482
|
+
await this.melCloudErv.send(this.accountType, this.displayType, deviceData, effectiveFlags);
|
|
496
483
|
const operationModeText = Ventilation.VentilationMode[deviceData.Device.VentilationMode];
|
|
497
484
|
if (this.logInfo) this.emit('info', `Set operation mode: ${operationModeText}`);
|
|
498
485
|
} catch (error) {
|
|
@@ -517,8 +504,7 @@ class DeviceErv extends EventEmitter {
|
|
|
517
504
|
.onSet(async (value) => {
|
|
518
505
|
try {
|
|
519
506
|
deviceData.Device.SetTemperature = value;
|
|
520
|
-
|
|
521
|
-
await this.melCloudErv.send(this.accountType, this.displayType, deviceData);
|
|
507
|
+
await this.melCloudErv.send(this.accountType, this.displayType, deviceData, Ventilation.EffectiveFlags.SetTemperature);
|
|
522
508
|
if (this.logInfo) this.emit('info', `Set temperature: ${value}${this.accessory.temperatureUnit}`);
|
|
523
509
|
} catch (error) {
|
|
524
510
|
if (this.logWarn) this.emit('warn', `Set temperature error: ${error}`);
|
|
@@ -700,7 +686,6 @@ class DeviceErv extends EventEmitter {
|
|
|
700
686
|
deviceData.Device.OperationMode = presetData.OperationMode;
|
|
701
687
|
deviceData.Device.VentilationMode = presetData.VentilationMode;
|
|
702
688
|
deviceData.Device.SetFanSpeed = presetData.FanSpeed;
|
|
703
|
-
deviceData.Device.EffectiveFlags = Ventilation.EffectiveFlags.Power;
|
|
704
689
|
break;
|
|
705
690
|
case false:
|
|
706
691
|
deviceData.Device.SetTemperature = preset.previousSettings.SetTemperature;
|
|
@@ -708,11 +693,10 @@ class DeviceErv extends EventEmitter {
|
|
|
708
693
|
deviceData.Device.OperationMode = preset.previousSettings.OperationMode;
|
|
709
694
|
deviceData.Device.VentilationMode = preset.previousSettings.VentilationMode;
|
|
710
695
|
deviceData.Device.SetFanSpeed = preset.previousSettings.FanSpeed;
|
|
711
|
-
deviceData.Device.EffectiveFlags = Ventilation.EffectiveFlags.Power;
|
|
712
696
|
break;
|
|
713
697
|
};
|
|
714
698
|
|
|
715
|
-
await this.melCloudErv.send(this.accountType, this.displayType, deviceData);
|
|
699
|
+
await this.melCloudErv.send(this.accountType, this.displayType, deviceData, Ventilation.EffectiveFlags.Power);
|
|
716
700
|
if (this.logInfo) this.emit('info', `${state ? 'Set:' : 'Unset:'} ${name}`);
|
|
717
701
|
} catch (error) {
|
|
718
702
|
if (this.logWarn) this.emit('warn', `Set preset error: ${error}`);
|
|
@@ -750,67 +734,68 @@ class DeviceErv extends EventEmitter {
|
|
|
750
734
|
})
|
|
751
735
|
.onSet(async (state) => {
|
|
752
736
|
try {
|
|
737
|
+
let effectiveFlags = null;
|
|
753
738
|
switch (mode) {
|
|
754
739
|
case 0: //POWER ON,OFF
|
|
755
740
|
deviceData.Device.Power = state;
|
|
756
|
-
|
|
741
|
+
effectiveFlags = Ventilation.EffectiveFlags.Power;
|
|
757
742
|
break;
|
|
758
743
|
case 1: //OPERATING MODE RECOVERY
|
|
759
744
|
button.previousValue = state ? deviceData.Device.VentilationMode : button.previousValue ?? deviceData.Device.VentilationMode;
|
|
760
745
|
deviceData.Device.Power = true;
|
|
761
746
|
deviceData.Device.VentilationMode = state ? 0 : button.previousValue;
|
|
762
|
-
|
|
747
|
+
effectiveFlags = Ventilation.EffectiveFlags.Power + Ventilation.EffectiveFlags.VentilationMode;
|
|
763
748
|
break;
|
|
764
749
|
case 2: //OPERATING MODE BYPASS
|
|
765
750
|
button.previousValue = state ? deviceData.Device.VentilationMode : button.previousValue ?? deviceData.Device.VentilationMode;
|
|
766
751
|
deviceData.Device.Power = true;
|
|
767
752
|
deviceData.Device.VentilationMode = state ? 1 : button.previousValue;
|
|
768
|
-
|
|
753
|
+
effectiveFlags = Ventilation.EffectiveFlags.Power + Ventilation.EffectiveFlags.VentilationMode;
|
|
769
754
|
break
|
|
770
755
|
case 3: //OPERATING MODE AUTO
|
|
771
756
|
button.previousValue = state ? deviceData.Device.VentilationMode : button.previousValue ?? deviceData.Device.VentilationMode;
|
|
772
757
|
deviceData.Device.Power = true;
|
|
773
758
|
deviceData.Device.VentilationMode = state ? 2 : button.previousValue;
|
|
774
|
-
|
|
759
|
+
effectiveFlags = Ventilation.EffectiveFlags.Power + Ventilation.EffectiveFlags.VentilationMode;
|
|
775
760
|
break;
|
|
776
761
|
case 4: //NIGHT PURGE MODE
|
|
777
762
|
deviceData.Device.Power = true;
|
|
778
763
|
deviceData.Device.NightPurgeMode = state;
|
|
779
|
-
|
|
764
|
+
effectiveFlags = Ventilation.EffectiveFlags.Power
|
|
780
765
|
break;
|
|
781
766
|
case 10: //FAN SPEED MODE AUTO
|
|
782
767
|
button.previousValue = state ? deviceData.Device.SetFanSpeed : button.previousValue ?? deviceData.Device.SetFanSpeed;
|
|
783
768
|
deviceData.Device.Power = true;
|
|
784
769
|
deviceData.Device.SetFanSpeed = state ? 0 : button.previousValue;
|
|
785
|
-
|
|
770
|
+
effectiveFlags = Ventilation.EffectiveFlags.Power + Ventilation.EffectiveFlags.SetFanSpeed;
|
|
786
771
|
break;
|
|
787
772
|
case 11: //FAN SPEED MODE 1
|
|
788
773
|
button.previousValue = state ? deviceData.Device.SetFanSpeed : button.previousValue ?? deviceData.Device.SetFanSpeed;
|
|
789
774
|
deviceData.Device.Power = true;
|
|
790
775
|
deviceData.Device.SetFanSpeed = state ? 1 : button.previousValue;
|
|
791
|
-
|
|
776
|
+
effectiveFlags = Ventilation.EffectiveFlags.Power + Ventilation.EffectiveFlags.SetFanSpeed;
|
|
792
777
|
break;
|
|
793
778
|
case 12: //FAN SPEED MODE 2
|
|
794
779
|
button.previousValue = state ? deviceData.Device.SetFanSpeed : button.previousValue ?? deviceData.Device.SetFanSpeed;
|
|
795
780
|
deviceData.Device.Power = true;
|
|
796
781
|
deviceData.Device.SetFanSpeed = state ? 2 : button.previousValue;
|
|
797
|
-
|
|
782
|
+
effectiveFlags = Ventilation.EffectiveFlags.Power + Ventilation.EffectiveFlags.SetFanSpeed;
|
|
798
783
|
break;
|
|
799
784
|
case 13: //FAN SPEED MODE 3
|
|
800
785
|
button.previousValue = state ? deviceData.Device.SetFanSpeed : button.previousValue ?? deviceData.Device.SetFanSpeed;
|
|
801
786
|
deviceData.Device.Power = true;
|
|
802
787
|
deviceData.Device.SetFanSpeed = state ? 3 : button.previousValue;
|
|
803
|
-
|
|
788
|
+
effectiveFlags = Ventilation.EffectiveFlags.Power + Ventilation.EffectiveFlags.SetFanSpeed;
|
|
804
789
|
break;
|
|
805
790
|
case 14: //FAN MODE 4
|
|
806
791
|
button.previousValue = state ? deviceData.Device.SetFanSpeed : button.previousValue ?? deviceData.Device.SetFanSpeed;
|
|
807
792
|
deviceData.Device.Power = true;
|
|
808
793
|
deviceData.Device.SetFanSpeed = state ? 4 : button.previousValue;
|
|
809
|
-
|
|
794
|
+
effectiveFlags = Ventilation.EffectiveFlags.Power + Ventilation.EffectiveFlags.SetFanSpeed;
|
|
810
795
|
break;
|
|
811
796
|
case 15: //PHYSICAL LOCK CONTROLS
|
|
812
797
|
deviceData.Device = deviceData.Device;
|
|
813
|
-
|
|
798
|
+
effectiveFlags = Ventilation.EffectiveFlags.Prohibit;
|
|
814
799
|
break;
|
|
815
800
|
case 16: //ROOM TEMP HIDE
|
|
816
801
|
deviceData.HideRoomTemperature = state;
|
|
@@ -826,7 +811,7 @@ class DeviceErv extends EventEmitter {
|
|
|
826
811
|
break;
|
|
827
812
|
};
|
|
828
813
|
|
|
829
|
-
await this.melCloudErv.send(this.accountType, this.displayType, deviceData);
|
|
814
|
+
await this.melCloudErv.send(this.accountType, this.displayType, deviceData, effectiveFlags);
|
|
830
815
|
if (this.logInfo) this.emit('info', `${state ? `Set: ${buttonName}` : `Unset: ${buttonName}, Set: ${button.previousValue}`}`);
|
|
831
816
|
} catch (error) {
|
|
832
817
|
if (this.logWarn) this.emit('warn', `Set button error: ${error}`);
|
package/src/impulsegenerator.js
CHANGED
|
@@ -7,7 +7,7 @@ class ImpulseGenerator extends EventEmitter {
|
|
|
7
7
|
this.timers = [];
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
async state(state, timers = []) {
|
|
10
|
+
async state(state, timers = [], runOnStart = true) {
|
|
11
11
|
// Stop current timers before new start
|
|
12
12
|
if (this.timersState && state) {
|
|
13
13
|
await this.state(false);
|
|
@@ -19,7 +19,7 @@ class ImpulseGenerator extends EventEmitter {
|
|
|
19
19
|
for (const { name, sampling } of timers) {
|
|
20
20
|
if (!name || !sampling) continue;
|
|
21
21
|
|
|
22
|
-
this.emit(name);
|
|
22
|
+
if (runOnStart) this.emit(name);
|
|
23
23
|
|
|
24
24
|
const interval = setInterval(() => {
|
|
25
25
|
this.emit(name);
|
package/src/melcloudatw.js
CHANGED
|
@@ -177,7 +177,7 @@ class MelCloudAtw extends EventEmitter {
|
|
|
177
177
|
};
|
|
178
178
|
};
|
|
179
179
|
|
|
180
|
-
async send(accountType, displayType, deviceData) {
|
|
180
|
+
async send(accountType, displayType, deviceData, effectiveFlags) {
|
|
181
181
|
try {
|
|
182
182
|
switch (accountType) {
|
|
183
183
|
case "melcloud":
|
|
@@ -205,6 +205,7 @@ class MelCloudAtw extends EventEmitter {
|
|
|
205
205
|
deviceData.Device.SetTankWaterTemperature = deviceData.Device.SetTankWaterTemperature < minTempWaterTank ? minTempWaterTank : deviceData.Device.SetTankWaterTemperature;
|
|
206
206
|
deviceData.Device.SetTankWaterTemperature = deviceData.Device.SetTankWaterTemperature > maxTempWaterTank ? maxTempWaterTank : deviceData.Device.SetTankWaterTemperature;
|
|
207
207
|
|
|
208
|
+
deviceData.Device.EffectiveFlags = effectiveFlags;
|
|
208
209
|
const payload = {
|
|
209
210
|
data: {
|
|
210
211
|
DeviceID: deviceData.Device.DeviceID,
|
package/src/melclouderv.js
CHANGED
|
@@ -169,7 +169,7 @@ class MelCloudErv extends EventEmitter {
|
|
|
169
169
|
};
|
|
170
170
|
};
|
|
171
171
|
|
|
172
|
-
async send(accountType, displayType, deviceData) {
|
|
172
|
+
async send(accountType, displayType, deviceData, effectiveFlags) {
|
|
173
173
|
try {
|
|
174
174
|
switch (accountType) {
|
|
175
175
|
case "melcloud":
|
|
@@ -205,6 +205,7 @@ class MelCloudErv extends EventEmitter {
|
|
|
205
205
|
};
|
|
206
206
|
|
|
207
207
|
//device state
|
|
208
|
+
deviceData.Device.EffectiveFlags = effectiveFlags;
|
|
208
209
|
const payload = {
|
|
209
210
|
data: {
|
|
210
211
|
DeviceID: deviceData.Device.DeviceID,
|