homebridge-melcloud-control 4.0.0-beta.102 → 4.0.0-beta.103
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 +25 -24
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.103",
|
|
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
|
@@ -17,6 +17,7 @@ class DeviceAta extends EventEmitter {
|
|
|
17
17
|
|
|
18
18
|
//account config
|
|
19
19
|
this.accountMelcloud = account.displayType === 'melcloud' ? true : false;
|
|
20
|
+
this.accountDisplayType = account.displayType;
|
|
20
21
|
this.device = device;
|
|
21
22
|
this.displayMode = device.displayMode;
|
|
22
23
|
this.temperatureSensor = device.temperatureSensor || false;
|
|
@@ -155,67 +156,67 @@ class DeviceAta extends EventEmitter {
|
|
|
155
156
|
case 'Power':
|
|
156
157
|
deviceData.Device[key] = value;
|
|
157
158
|
deviceData.Device.EffectiveFlags = AirConditioner.EffectiveFlags.Power;
|
|
158
|
-
set = await this.melCloudAta.send(this.
|
|
159
|
+
set = await this.melCloudAta.send(this.accountDisplayType, deviceData, this.displayMode);
|
|
159
160
|
break;
|
|
160
161
|
case 'OperationMode':
|
|
161
162
|
deviceData.Device[key] = value;
|
|
162
163
|
deviceData.Device.EffectiveFlags = AirConditioner.EffectiveFlags.OperationModeSetTemperature;
|
|
163
|
-
set = await this.melCloudAta.send(this.
|
|
164
|
+
set = await this.melCloudAta.send(this.accountDisplayType, deviceData, this.displayMode);
|
|
164
165
|
break;
|
|
165
166
|
case 'SetTemperature':
|
|
166
167
|
deviceData.Device[key] = value;
|
|
167
168
|
deviceData.Device.EffectiveFlags = AirConditioner.EffectiveFlags.SetTemperature;
|
|
168
|
-
set = await this.melCloudAta.send(this.
|
|
169
|
+
set = await this.melCloudAta.send(this.accountDisplayType, deviceData, this.displayMode);
|
|
169
170
|
break;
|
|
170
171
|
case 'DefaultCoolingSetTemperature':
|
|
171
172
|
deviceData.Device[key] = value;
|
|
172
173
|
deviceData.Device.EffectiveFlags = AirConditioner.EffectiveFlags.SetTemperature;
|
|
173
|
-
set = await this.melCloudAta.send(this.
|
|
174
|
+
set = await this.melCloudAta.send(this.accountDisplayType, deviceData, this.displayMode);
|
|
174
175
|
break;
|
|
175
176
|
case 'DefaultHeatingSetTemperature':
|
|
176
177
|
deviceData.Device[key] = value;
|
|
177
178
|
deviceData.Device.EffectiveFlags = AirConditioner.EffectiveFlags.SetTemperature;
|
|
178
|
-
set = await this.melCloudAta.send(this.
|
|
179
|
+
set = await this.melCloudAta.send(this.accountDisplayType, deviceData, this.displayMode);
|
|
179
180
|
break;
|
|
180
181
|
case 'FanSpeed':
|
|
181
182
|
deviceData.Device[key] = value;
|
|
182
183
|
deviceData.Device.EffectiveFlags = AirConditioner.EffectiveFlags.SetFanSpeed;
|
|
183
|
-
set = await this.melCloudAta.send(this.
|
|
184
|
+
set = await this.melCloudAta.send(this.accountDisplayType, deviceData, this.displayMode);
|
|
184
185
|
break;
|
|
185
186
|
case 'VaneHorizontalDirection':
|
|
186
187
|
deviceData.Device[key] = value;
|
|
187
188
|
deviceData.Device.EffectiveFlags = AirConditioner.EffectiveFlags.VaneHorizontal;
|
|
188
|
-
set = await this.melCloudAta.send(this.
|
|
189
|
+
set = await this.melCloudAta.send(this.accountDisplayType, deviceData, this.displayMode);
|
|
189
190
|
break;
|
|
190
191
|
case 'VaneVerticalDirection':
|
|
191
192
|
deviceData.Device[key] = value;
|
|
192
193
|
deviceData.Device.EffectiveFlags = AirConditioner.EffectiveFlags.VaneVertical;
|
|
193
|
-
set = await this.melCloudAta.send(this.
|
|
194
|
+
set = await this.melCloudAta.send(this.accountDisplayType, deviceData, this.displayMode);
|
|
194
195
|
break;
|
|
195
196
|
case 'HideVaneControls':
|
|
196
197
|
deviceData[key] = value;
|
|
197
198
|
deviceData.Device.EffectiveFlags = AirConditioner.EffectiveFlags.Prohibit;
|
|
198
|
-
set = await this.melCloudAta.send(this.
|
|
199
|
+
set = await this.melCloudAta.send(this.accountDisplayType, deviceData, this.displayMode);
|
|
199
200
|
break;
|
|
200
201
|
case 'HideDryModeControl':
|
|
201
202
|
deviceData[key] = value;
|
|
202
203
|
deviceData.Device.EffectiveFlags = AirConditioner.EffectiveFlags.Prohibit;
|
|
203
|
-
await this.melCloudAta.send(this.
|
|
204
|
+
await this.melCloudAta.send(this.accountDisplayType, deviceData, this.displayMode);
|
|
204
205
|
break;
|
|
205
206
|
case 'ProhibitSetTemperature':
|
|
206
207
|
deviceData.Device[key] = value;
|
|
207
208
|
deviceData.Device.EffectiveFlags = AirConditioner.EffectiveFlags.Prohibit;
|
|
208
|
-
set = await this.melCloudAta.send(this.
|
|
209
|
+
set = await this.melCloudAta.send(this.accountDisplayType, deviceData, this.displayMode);
|
|
209
210
|
break;
|
|
210
211
|
case 'ProhibitOperationMode':
|
|
211
212
|
deviceData.Device[key] = value;
|
|
212
213
|
deviceData.Device.EffectiveFlags = AirConditioner.EffectiveFlags.Prohibit;
|
|
213
|
-
await this.melCloudAta.send(this.
|
|
214
|
+
await this.melCloudAta.send(this.accountDisplayType, deviceData, this.displayMode);
|
|
214
215
|
break;
|
|
215
216
|
case 'ProhibitPower':
|
|
216
217
|
deviceData.Device[key] = value;
|
|
217
218
|
deviceData.Device.EffectiveFlags = AirConditioner.EffectiveFlags.Prohibit;
|
|
218
|
-
set = await this.melCloudAta.send(this.
|
|
219
|
+
set = await this.melCloudAta.send(this.accountDisplayType, deviceData, this.displayMode);
|
|
219
220
|
break;
|
|
220
221
|
default:
|
|
221
222
|
this.emit('warn', `${integration}, received key: ${key}, value: ${value}`);
|
|
@@ -291,7 +292,7 @@ class DeviceAta extends EventEmitter {
|
|
|
291
292
|
try {
|
|
292
293
|
deviceData.Device.Power = [false, true][state];
|
|
293
294
|
deviceData.Device.EffectiveFlags = AirConditioner.EffectiveFlags.Power;
|
|
294
|
-
await this.melCloudAta.send(this.
|
|
295
|
+
await this.melCloudAta.send(this.accountDisplayType, deviceData, this.displayMode);
|
|
295
296
|
if (this.logInfo) this.emit('info', `Set power: ${state ? 'ON' : 'OFF'}`);
|
|
296
297
|
} catch (error) {
|
|
297
298
|
if (this.logWarn) this.emit('warn', `Set power error: ${error}`);
|
|
@@ -327,7 +328,7 @@ class DeviceAta extends EventEmitter {
|
|
|
327
328
|
};
|
|
328
329
|
|
|
329
330
|
deviceData.Device.EffectiveFlags = AirConditioner.EffectiveFlags.OperationModeSetTemperature;
|
|
330
|
-
await this.melCloudAta.send(this.
|
|
331
|
+
await this.melCloudAta.send(this.accountDisplayType, deviceData, this.displayMode);
|
|
331
332
|
const operationModeText = AirConditioner.OperationMode[deviceData.Device.OperationMode];
|
|
332
333
|
if (this.logInfo) this.emit('info', `Set operation mode: ${operationModeText}`);
|
|
333
334
|
} catch (error) {
|
|
@@ -376,7 +377,7 @@ class DeviceAta extends EventEmitter {
|
|
|
376
377
|
break;
|
|
377
378
|
};
|
|
378
379
|
deviceData.Device.EffectiveFlags = AirConditioner.EffectiveFlags.SetFanSpeed;
|
|
379
|
-
await this.melCloudAta.send(this.
|
|
380
|
+
await this.melCloudAta.send(this.accountDisplayType, deviceData, this.displayMode);
|
|
380
381
|
if (this.logInfo) this.emit('info', `Set fan speed mode: ${AirConditioner.FanSpeed[fanSpeedModeText]}`);
|
|
381
382
|
} catch (error) {
|
|
382
383
|
if (this.logWarn) this.emit('warn', `Set fan speed mode error: ${error}`);
|
|
@@ -395,7 +396,7 @@ class DeviceAta extends EventEmitter {
|
|
|
395
396
|
deviceData.Device.VaneHorizontal = value ? 12 : 0;
|
|
396
397
|
deviceData.Device.VaneVertical = value ? 7 : 0;
|
|
397
398
|
deviceData.Device.EffectiveFlags = AirConditioner.EffectiveFlags.VaneVerticalVaneHorizontal;
|
|
398
|
-
await this.melCloudAta.send(this.
|
|
399
|
+
await this.melCloudAta.send(this.accountDisplayType, deviceData, this.displayMode);
|
|
399
400
|
if (this.logInfo) this.emit('info', `Set air direction mode: ${AirConditioner.AirDirection[value]}`);
|
|
400
401
|
} catch (error) {
|
|
401
402
|
if (this.logWarn) this.emit('warn', `Set vane swing mode error: ${error}`);
|
|
@@ -416,7 +417,7 @@ class DeviceAta extends EventEmitter {
|
|
|
416
417
|
try {
|
|
417
418
|
deviceData.Device.DefaultCoolingSetTemperature = value;
|
|
418
419
|
deviceData.Device.EffectiveFlags = AirConditioner.EffectiveFlags.SetTemperature;
|
|
419
|
-
await this.melCloudAta.send(this.
|
|
420
|
+
await this.melCloudAta.send(this.accountDisplayType, deviceData, this.displayMode);
|
|
420
421
|
if (this.logInfo) this.emit('info', `Set cooling threshold temperature: ${value}${this.accessory.temperatureUnit}`);
|
|
421
422
|
} catch (error) {
|
|
422
423
|
if (this.logWarn) this.emit('warn', `Set cooling threshold temperature error: ${error}`);
|
|
@@ -437,7 +438,7 @@ class DeviceAta extends EventEmitter {
|
|
|
437
438
|
try {
|
|
438
439
|
deviceData.Device.DefaultHeatingSetTemperature = value;
|
|
439
440
|
deviceData.Device.EffectiveFlags = AirConditioner.EffectiveFlags.SetTemperature;
|
|
440
|
-
await this.melCloudAta.send(this.
|
|
441
|
+
await this.melCloudAta.send(this.accountDisplayType, deviceData, this.displayMode);
|
|
441
442
|
if (this.logInfo) this.emit('info', `Set heating threshold temperature: ${value}${this.accessory.temperatureUnit}`);
|
|
442
443
|
} catch (error) {
|
|
443
444
|
if (this.logWarn) this.emit('warn', `Set heating threshold temperature error: ${error}`);
|
|
@@ -456,7 +457,7 @@ class DeviceAta extends EventEmitter {
|
|
|
456
457
|
deviceData.Device.ProhibitOperationMode = value;
|
|
457
458
|
deviceData.Device.ProhibitPower = value;
|
|
458
459
|
deviceData.Device.EffectiveFlags = AirConditioner.EffectiveFlags.Prohibit;
|
|
459
|
-
await this.melCloudAta.send(this.
|
|
460
|
+
await this.melCloudAta.send(this.accountDisplayType, deviceData, this.displayMode);
|
|
460
461
|
if (this.logInfo) this.emit('info', `Set local physical controls: ${value ? 'LOCK' : 'UNLOCK'}`);
|
|
461
462
|
} catch (error) {
|
|
462
463
|
if (this.logWarn) this.emit('warn', `Set lock physical controls error: ${error}`);
|
|
@@ -522,7 +523,7 @@ class DeviceAta extends EventEmitter {
|
|
|
522
523
|
break;
|
|
523
524
|
};
|
|
524
525
|
|
|
525
|
-
await this.melCloudAta.send(this.
|
|
526
|
+
await this.melCloudAta.send(this.accountDisplayType, deviceData, this.displayMode);
|
|
526
527
|
const operationModeText = AirConditioner.OperationMode[deviceData.Device.OperationMode];
|
|
527
528
|
if (this.logInfo) this.emit('info', `Set operation mode: ${operationModeText}`);
|
|
528
529
|
} catch (error) {
|
|
@@ -548,7 +549,7 @@ class DeviceAta extends EventEmitter {
|
|
|
548
549
|
try {
|
|
549
550
|
deviceData.Device.SetTemperature = value;
|
|
550
551
|
deviceData.Device.EffectiveFlags = AirConditioner.EffectiveFlags.SetTemperature;
|
|
551
|
-
await this.melCloudAta.send(this.
|
|
552
|
+
await this.melCloudAta.send(this.accountDisplayType, deviceData, this.displayMode);
|
|
552
553
|
if (this.logInfo) this.emit('info', `Set temperature: ${value}${this.accessory.temperatureUnit}`);
|
|
553
554
|
} catch (error) {
|
|
554
555
|
if (this.logWarn) this.emit('warn', `Set temperature error: ${error}`);
|
|
@@ -658,7 +659,7 @@ class DeviceAta extends EventEmitter {
|
|
|
658
659
|
break;
|
|
659
660
|
};
|
|
660
661
|
|
|
661
|
-
await this.melCloudAta.send(this.
|
|
662
|
+
await this.melCloudAta.send(this.accountDisplayType, deviceData, this.displayMode);
|
|
662
663
|
if (this.logInfo) this.emit('info', `${state ? 'Set:' : 'Unset:'} ${name}`);
|
|
663
664
|
} catch (error) {
|
|
664
665
|
if (this.logWarn) this.emit('warn', `Set preset error: ${error}`);
|
|
@@ -898,7 +899,7 @@ class DeviceAta extends EventEmitter {
|
|
|
898
899
|
break;
|
|
899
900
|
};
|
|
900
901
|
|
|
901
|
-
await this.melCloudAta.send(this.
|
|
902
|
+
await this.melCloudAta.send(this.accountDisplayType, deviceData, this.displayMode);
|
|
902
903
|
if (this.logInfo) this.emit('info', `${state ? `Set: ${name}` : `Unset: ${name}, Set: ${button.previousValue}`}`);
|
|
903
904
|
} catch (error) {
|
|
904
905
|
if (this.logWarn) this.emit('warn', `Set button error: ${error}`);
|