homebridge-melcloud-control 4.0.0-beta.113 → 4.0.0-beta.115
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 +7 -5
- package/package.json +1 -1
- package/src/deviceata.js +26 -26
- package/src/melcloud.js +27 -20
- package/src/melcloudata.js +11 -13
package/index.js
CHANGED
|
@@ -30,8 +30,8 @@ class MelCloudPlatform {
|
|
|
30
30
|
api.on('didFinishLaunching', async () => {
|
|
31
31
|
//loop through accounts
|
|
32
32
|
for (const account of config.accounts) {
|
|
33
|
-
const
|
|
34
|
-
if (
|
|
33
|
+
const accountType = account.accountType || 'disabled';
|
|
34
|
+
if (accountType === 'disabled') continue;
|
|
35
35
|
|
|
36
36
|
const accountName = account.name;
|
|
37
37
|
const user = account.user;
|
|
@@ -90,7 +90,7 @@ class MelCloudPlatform {
|
|
|
90
90
|
.on('start', async () => {
|
|
91
91
|
try {
|
|
92
92
|
//melcloud account
|
|
93
|
-
const melCloud = new MelCloud(
|
|
93
|
+
const melCloud = new MelCloud(accountType, user, passwd, language, accountFile, buildingsFile, devicesFile, logLevel.warn, logLevel.debug, false)
|
|
94
94
|
.on('success', (msg) => logLevel.success && log.success(`${accountName}, ${msg}`))
|
|
95
95
|
.on('info', (msg) => logLevel.info && log.info(`${accountName}, ${msg}`))
|
|
96
96
|
.on('debug', (msg) => logLevel.debug && log.info(`${accountName}, debug: ${msg}`))
|
|
@@ -181,8 +181,10 @@ class MelCloudPlatform {
|
|
|
181
181
|
api.publishExternalAccessories(PluginName, [accessory]);
|
|
182
182
|
if (logLevel.success) log.success(`${accountName}, ${deviceTypeText}, ${deviceName}, Published as external accessory.`);
|
|
183
183
|
|
|
184
|
-
//start impulse generators
|
|
185
|
-
|
|
184
|
+
//start impulse generators\
|
|
185
|
+
const timmers = accountType === 'melcloudhome' ? [{ name: 'connect', sampling: 150000 }, { name: 'checkDevicesList', sampling: deviceRefreshInterval }] : [{ name: 'checkDevicesList', sampling: refreshInterval }];
|
|
186
|
+
const impulseGenerator = configuredDevice.getImpulseGenerator();
|
|
187
|
+
await melCloud.impulseGenerator.state(true, timmers);
|
|
186
188
|
await configuredDevice.startStopImpulseGenerator(true, [{ name: 'checkState', sampling: deviceRefreshInterval }]);
|
|
187
189
|
|
|
188
190
|
//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.115",
|
|
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,7 +17,7 @@ class DeviceAta extends EventEmitter {
|
|
|
17
17
|
|
|
18
18
|
//account config
|
|
19
19
|
this.accountMelcloud = account.displayType === 'melcloud' ? true : false;
|
|
20
|
-
this.
|
|
20
|
+
this.accountType = account.displayType;
|
|
21
21
|
this.device = device;
|
|
22
22
|
this.displayMode = device.displayMode;
|
|
23
23
|
this.temperatureSensor = device.temperatureSensor || false;
|
|
@@ -156,67 +156,67 @@ class DeviceAta extends EventEmitter {
|
|
|
156
156
|
case 'Power':
|
|
157
157
|
deviceData.Device[key] = value;
|
|
158
158
|
deviceData.Device.EffectiveFlags = AirConditioner.EffectiveFlags.Power;
|
|
159
|
-
set = await this.melCloudAta.send(this.
|
|
159
|
+
set = await this.melCloudAta.send(this.accountType, deviceData, this.displayMode);
|
|
160
160
|
break;
|
|
161
161
|
case 'OperationMode':
|
|
162
162
|
deviceData.Device[key] = value;
|
|
163
163
|
deviceData.Device.EffectiveFlags = AirConditioner.EffectiveFlags.OperationModeSetTemperature;
|
|
164
|
-
set = await this.melCloudAta.send(this.
|
|
164
|
+
set = await this.melCloudAta.send(this.accountType, deviceData, this.displayMode);
|
|
165
165
|
break;
|
|
166
166
|
case 'SetTemperature':
|
|
167
167
|
deviceData.Device[key] = value;
|
|
168
168
|
deviceData.Device.EffectiveFlags = AirConditioner.EffectiveFlags.SetTemperature;
|
|
169
|
-
set = await this.melCloudAta.send(this.
|
|
169
|
+
set = await this.melCloudAta.send(this.accountType, deviceData, this.displayMode);
|
|
170
170
|
break;
|
|
171
171
|
case 'DefaultCoolingSetTemperature':
|
|
172
172
|
deviceData.Device[key] = value;
|
|
173
173
|
deviceData.Device.EffectiveFlags = AirConditioner.EffectiveFlags.SetTemperature;
|
|
174
|
-
set = await this.melCloudAta.send(this.
|
|
174
|
+
set = await this.melCloudAta.send(this.accountType, deviceData, this.displayMode);
|
|
175
175
|
break;
|
|
176
176
|
case 'DefaultHeatingSetTemperature':
|
|
177
177
|
deviceData.Device[key] = value;
|
|
178
178
|
deviceData.Device.EffectiveFlags = AirConditioner.EffectiveFlags.SetTemperature;
|
|
179
|
-
set = await this.melCloudAta.send(this.
|
|
179
|
+
set = await this.melCloudAta.send(this.accountType, deviceData, this.displayMode);
|
|
180
180
|
break;
|
|
181
181
|
case 'FanSpeed':
|
|
182
182
|
deviceData.Device[key] = value;
|
|
183
183
|
deviceData.Device.EffectiveFlags = AirConditioner.EffectiveFlags.SetFanSpeed;
|
|
184
|
-
set = await this.melCloudAta.send(this.
|
|
184
|
+
set = await this.melCloudAta.send(this.accountType, deviceData, this.displayMode);
|
|
185
185
|
break;
|
|
186
186
|
case 'VaneHorizontalDirection':
|
|
187
187
|
deviceData.Device[key] = value;
|
|
188
188
|
deviceData.Device.EffectiveFlags = AirConditioner.EffectiveFlags.VaneHorizontal;
|
|
189
|
-
set = await this.melCloudAta.send(this.
|
|
189
|
+
set = await this.melCloudAta.send(this.accountType, deviceData, this.displayMode);
|
|
190
190
|
break;
|
|
191
191
|
case 'VaneVerticalDirection':
|
|
192
192
|
deviceData.Device[key] = value;
|
|
193
193
|
deviceData.Device.EffectiveFlags = AirConditioner.EffectiveFlags.VaneVertical;
|
|
194
|
-
set = await this.melCloudAta.send(this.
|
|
194
|
+
set = await this.melCloudAta.send(this.accountType, deviceData, this.displayMode);
|
|
195
195
|
break;
|
|
196
196
|
case 'HideVaneControls':
|
|
197
197
|
deviceData[key] = value;
|
|
198
198
|
deviceData.Device.EffectiveFlags = AirConditioner.EffectiveFlags.Prohibit;
|
|
199
|
-
set = await this.melCloudAta.send(this.
|
|
199
|
+
set = await this.melCloudAta.send(this.accountType, deviceData, this.displayMode);
|
|
200
200
|
break;
|
|
201
201
|
case 'HideDryModeControl':
|
|
202
202
|
deviceData[key] = value;
|
|
203
203
|
deviceData.Device.EffectiveFlags = AirConditioner.EffectiveFlags.Prohibit;
|
|
204
|
-
await this.melCloudAta.send(this.
|
|
204
|
+
await this.melCloudAta.send(this.accountType, deviceData, this.displayMode);
|
|
205
205
|
break;
|
|
206
206
|
case 'ProhibitSetTemperature':
|
|
207
207
|
deviceData.Device[key] = value;
|
|
208
208
|
deviceData.Device.EffectiveFlags = AirConditioner.EffectiveFlags.Prohibit;
|
|
209
|
-
set = await this.melCloudAta.send(this.
|
|
209
|
+
set = await this.melCloudAta.send(this.accountType, deviceData, this.displayMode);
|
|
210
210
|
break;
|
|
211
211
|
case 'ProhibitOperationMode':
|
|
212
212
|
deviceData.Device[key] = value;
|
|
213
213
|
deviceData.Device.EffectiveFlags = AirConditioner.EffectiveFlags.Prohibit;
|
|
214
|
-
await this.melCloudAta.send(this.
|
|
214
|
+
await this.melCloudAta.send(this.accountType, deviceData, this.displayMode);
|
|
215
215
|
break;
|
|
216
216
|
case 'ProhibitPower':
|
|
217
217
|
deviceData.Device[key] = value;
|
|
218
218
|
deviceData.Device.EffectiveFlags = AirConditioner.EffectiveFlags.Prohibit;
|
|
219
|
-
set = await this.melCloudAta.send(this.
|
|
219
|
+
set = await this.melCloudAta.send(this.accountType, deviceData, this.displayMode);
|
|
220
220
|
break;
|
|
221
221
|
default:
|
|
222
222
|
this.emit('warn', `${integration}, received key: ${key}, value: ${value}`);
|
|
@@ -292,7 +292,7 @@ class DeviceAta extends EventEmitter {
|
|
|
292
292
|
try {
|
|
293
293
|
deviceData.Device.Power = [false, true][state];
|
|
294
294
|
deviceData.Device.EffectiveFlags = AirConditioner.EffectiveFlags.Power;
|
|
295
|
-
await this.melCloudAta.send(this.
|
|
295
|
+
await this.melCloudAta.send(this.accountType, deviceData, this.displayMode);
|
|
296
296
|
if (this.logInfo) this.emit('info', `Set power: ${state ? 'ON' : 'OFF'}`);
|
|
297
297
|
} catch (error) {
|
|
298
298
|
if (this.logWarn) this.emit('warn', `Set power error: ${error}`);
|
|
@@ -328,7 +328,7 @@ class DeviceAta extends EventEmitter {
|
|
|
328
328
|
};
|
|
329
329
|
|
|
330
330
|
deviceData.Device.EffectiveFlags = AirConditioner.EffectiveFlags.OperationModeSetTemperature;
|
|
331
|
-
await this.melCloudAta.send(this.
|
|
331
|
+
await this.melCloudAta.send(this.accountType, deviceData, this.displayMode);
|
|
332
332
|
const operationModeText = AirConditioner.OperationMode[deviceData.Device.OperationMode];
|
|
333
333
|
if (this.logInfo) this.emit('info', `Set operation mode: ${operationModeText}`);
|
|
334
334
|
} catch (error) {
|
|
@@ -377,7 +377,7 @@ class DeviceAta extends EventEmitter {
|
|
|
377
377
|
break;
|
|
378
378
|
};
|
|
379
379
|
deviceData.Device.EffectiveFlags = AirConditioner.EffectiveFlags.SetFanSpeed;
|
|
380
|
-
await this.melCloudAta.send(this.
|
|
380
|
+
await this.melCloudAta.send(this.accountType, deviceData, this.displayMode);
|
|
381
381
|
if (this.logInfo) this.emit('info', `Set fan speed mode: ${AirConditioner.FanSpeed[fanSpeedModeText]}`);
|
|
382
382
|
} catch (error) {
|
|
383
383
|
if (this.logWarn) this.emit('warn', `Set fan speed mode error: ${error}`);
|
|
@@ -396,7 +396,7 @@ class DeviceAta extends EventEmitter {
|
|
|
396
396
|
deviceData.Device.VaneHorizontal = value ? 12 : 0;
|
|
397
397
|
deviceData.Device.VaneVertical = value ? 7 : 0;
|
|
398
398
|
deviceData.Device.EffectiveFlags = AirConditioner.EffectiveFlags.VaneVerticalVaneHorizontal;
|
|
399
|
-
await this.melCloudAta.send(this.
|
|
399
|
+
await this.melCloudAta.send(this.accountType, deviceData, this.displayMode);
|
|
400
400
|
if (this.logInfo) this.emit('info', `Set air direction mode: ${AirConditioner.AirDirection[value]}`);
|
|
401
401
|
} catch (error) {
|
|
402
402
|
if (this.logWarn) this.emit('warn', `Set vane swing mode error: ${error}`);
|
|
@@ -417,7 +417,7 @@ class DeviceAta extends EventEmitter {
|
|
|
417
417
|
try {
|
|
418
418
|
deviceData.Device.DefaultCoolingSetTemperature = value;
|
|
419
419
|
deviceData.Device.EffectiveFlags = AirConditioner.EffectiveFlags.SetTemperature;
|
|
420
|
-
await this.melCloudAta.send(this.
|
|
420
|
+
await this.melCloudAta.send(this.accountType, deviceData, this.displayMode);
|
|
421
421
|
if (this.logInfo) this.emit('info', `Set cooling threshold temperature: ${value}${this.accessory.temperatureUnit}`);
|
|
422
422
|
} catch (error) {
|
|
423
423
|
if (this.logWarn) this.emit('warn', `Set cooling threshold temperature error: ${error}`);
|
|
@@ -438,7 +438,7 @@ class DeviceAta extends EventEmitter {
|
|
|
438
438
|
try {
|
|
439
439
|
deviceData.Device.DefaultHeatingSetTemperature = value;
|
|
440
440
|
deviceData.Device.EffectiveFlags = AirConditioner.EffectiveFlags.SetTemperature;
|
|
441
|
-
await this.melCloudAta.send(this.
|
|
441
|
+
await this.melCloudAta.send(this.accountType, deviceData, this.displayMode);
|
|
442
442
|
if (this.logInfo) this.emit('info', `Set heating threshold temperature: ${value}${this.accessory.temperatureUnit}`);
|
|
443
443
|
} catch (error) {
|
|
444
444
|
if (this.logWarn) this.emit('warn', `Set heating threshold temperature error: ${error}`);
|
|
@@ -457,7 +457,7 @@ class DeviceAta extends EventEmitter {
|
|
|
457
457
|
deviceData.Device.ProhibitOperationMode = value;
|
|
458
458
|
deviceData.Device.ProhibitPower = value;
|
|
459
459
|
deviceData.Device.EffectiveFlags = AirConditioner.EffectiveFlags.Prohibit;
|
|
460
|
-
await this.melCloudAta.send(this.
|
|
460
|
+
await this.melCloudAta.send(this.accountType, deviceData, this.displayMode);
|
|
461
461
|
if (this.logInfo) this.emit('info', `Set local physical controls: ${value ? 'LOCK' : 'UNLOCK'}`);
|
|
462
462
|
} catch (error) {
|
|
463
463
|
if (this.logWarn) this.emit('warn', `Set lock physical controls error: ${error}`);
|
|
@@ -523,7 +523,7 @@ class DeviceAta extends EventEmitter {
|
|
|
523
523
|
break;
|
|
524
524
|
};
|
|
525
525
|
|
|
526
|
-
await this.melCloudAta.send(this.
|
|
526
|
+
await this.melCloudAta.send(this.accountType, deviceData, this.displayMode);
|
|
527
527
|
const operationModeText = AirConditioner.OperationMode[deviceData.Device.OperationMode];
|
|
528
528
|
if (this.logInfo) this.emit('info', `Set operation mode: ${operationModeText}`);
|
|
529
529
|
} catch (error) {
|
|
@@ -549,7 +549,7 @@ class DeviceAta extends EventEmitter {
|
|
|
549
549
|
try {
|
|
550
550
|
deviceData.Device.SetTemperature = value;
|
|
551
551
|
deviceData.Device.EffectiveFlags = AirConditioner.EffectiveFlags.SetTemperature;
|
|
552
|
-
await this.melCloudAta.send(this.
|
|
552
|
+
await this.melCloudAta.send(this.accountType, deviceData, this.displayMode);
|
|
553
553
|
if (this.logInfo) this.emit('info', `Set temperature: ${value}${this.accessory.temperatureUnit}`);
|
|
554
554
|
} catch (error) {
|
|
555
555
|
if (this.logWarn) this.emit('warn', `Set temperature error: ${error}`);
|
|
@@ -659,7 +659,7 @@ class DeviceAta extends EventEmitter {
|
|
|
659
659
|
break;
|
|
660
660
|
};
|
|
661
661
|
|
|
662
|
-
await this.melCloudAta.send(this.
|
|
662
|
+
await this.melCloudAta.send(this.accountType, deviceData, this.displayMode);
|
|
663
663
|
if (this.logInfo) this.emit('info', `${state ? 'Set:' : 'Unset:'} ${name}`);
|
|
664
664
|
} catch (error) {
|
|
665
665
|
if (this.logWarn) this.emit('warn', `Set preset error: ${error}`);
|
|
@@ -899,7 +899,7 @@ class DeviceAta extends EventEmitter {
|
|
|
899
899
|
break;
|
|
900
900
|
};
|
|
901
901
|
|
|
902
|
-
await this.melCloudAta.send(this.
|
|
902
|
+
await this.melCloudAta.send(this.accountType, deviceData, this.displayMode);
|
|
903
903
|
if (this.logInfo) this.emit('info', `${state ? `Set: ${name}` : `Unset: ${name}, Set: ${button.previousValue}`}`);
|
|
904
904
|
} catch (error) {
|
|
905
905
|
if (this.logWarn) this.emit('warn', `Set button error: ${error}`);
|
|
@@ -943,7 +943,7 @@ class DeviceAta extends EventEmitter {
|
|
|
943
943
|
this.informationService?.setCharacteristic(Characteristic.FirmwareRevision, firmwareAppVersion);
|
|
944
944
|
})
|
|
945
945
|
.on('deviceState', async (deviceData) => {
|
|
946
|
-
if (this.
|
|
946
|
+
if (this.accountType === 'melcloudhome') deviceData.Device.OperationMode = AirConditioner.OperationModeMapStringToEnum[deviceData.Device.OperationMode];
|
|
947
947
|
this.deviceData = deviceData;
|
|
948
948
|
|
|
949
949
|
//presets
|
package/src/melcloud.js
CHANGED
|
@@ -7,9 +7,9 @@ import Functions from './functions.js';
|
|
|
7
7
|
import { ApiUrls, ApiUrlsHome } from './constants.js';
|
|
8
8
|
|
|
9
9
|
class MelCloud extends EventEmitter {
|
|
10
|
-
constructor(
|
|
10
|
+
constructor(accountType, user, passwd, language, accountFile, buildingsFile, devicesFile, logWarn, logDebug, requestConfig) {
|
|
11
11
|
super();
|
|
12
|
-
this.
|
|
12
|
+
this.accountType = accountType;
|
|
13
13
|
this.user = user;
|
|
14
14
|
this.passwd = passwd;
|
|
15
15
|
this.language = language;
|
|
@@ -45,6 +45,13 @@ class MelCloud extends EventEmitter {
|
|
|
45
45
|
|
|
46
46
|
if (!requestConfig) {
|
|
47
47
|
this.impulseGenerator = new ImpulseGenerator()
|
|
48
|
+
.on('connect', async () => {
|
|
49
|
+
try {
|
|
50
|
+
await this.connect();
|
|
51
|
+
} catch (error) {
|
|
52
|
+
this.emit('error', `Impulse generator error: ${error}`);
|
|
53
|
+
}
|
|
54
|
+
})
|
|
48
55
|
.on('checkDevicesList', async () => {
|
|
49
56
|
try {
|
|
50
57
|
await this.checkDevicesList(this.contextKey);
|
|
@@ -292,13 +299,13 @@ class MelCloud extends EventEmitter {
|
|
|
292
299
|
if (!loginBtn && this.logWarn) this.emit('warn', `Login button not found`);
|
|
293
300
|
|
|
294
301
|
// Set credentials and login
|
|
295
|
-
await Promise.all([loginBtn.click(), page.waitForNavigation({ waitUntil: 'networkidle2', timeout:
|
|
296
|
-
await page.waitForSelector('input[name="username"]', { timeout:
|
|
302
|
+
await Promise.all([loginBtn.click(), page.waitForNavigation({ waitUntil: 'networkidle2', timeout: 5000 })]);
|
|
303
|
+
await page.waitForSelector('input[name="username"]', { timeout: 5000 });
|
|
297
304
|
await page.type('input[name="username"]', this.user, { delay: 50 });
|
|
298
305
|
await page.type('input[name="password"]', this.passwd, { delay: 50 });
|
|
299
306
|
|
|
300
307
|
const button1 = await page.$('input[type="submit"]');
|
|
301
|
-
await Promise.all([button1.click(), page.waitForNavigation({ waitUntil: 'networkidle2', timeout:
|
|
308
|
+
await Promise.all([button1.click(), page.waitForNavigation({ waitUntil: 'networkidle2', timeout: 5000 })]);
|
|
302
309
|
|
|
303
310
|
// Get cookies C1 and C2
|
|
304
311
|
let c1 = null, c2 = null;
|
|
@@ -332,23 +339,9 @@ class MelCloud extends EventEmitter {
|
|
|
332
339
|
}
|
|
333
340
|
}
|
|
334
341
|
|
|
335
|
-
async connect() {
|
|
336
|
-
let response = {};
|
|
337
|
-
switch (this.displayType) {
|
|
338
|
-
case "melcloud":
|
|
339
|
-
response = await this.connectToMelCloud();
|
|
340
|
-
return response
|
|
341
|
-
case "melcloudhome":
|
|
342
|
-
response = await this.connectToMelCloudHome();
|
|
343
|
-
return response
|
|
344
|
-
default:
|
|
345
|
-
return response
|
|
346
|
-
}
|
|
347
|
-
}
|
|
348
|
-
|
|
349
342
|
async checkDevicesList(contextKey) {
|
|
350
343
|
let devices = [];
|
|
351
|
-
switch (this.
|
|
344
|
+
switch (this.accountType) {
|
|
352
345
|
case "melcloud":
|
|
353
346
|
devices = await this.checkMelcloudDevicesList(contextKey);
|
|
354
347
|
return devices
|
|
@@ -360,6 +353,20 @@ class MelCloud extends EventEmitter {
|
|
|
360
353
|
}
|
|
361
354
|
}
|
|
362
355
|
|
|
356
|
+
async connect() {
|
|
357
|
+
let response = {};
|
|
358
|
+
switch (this.accountType) {
|
|
359
|
+
case "melcloud":
|
|
360
|
+
response = await this.connectToMelCloud();
|
|
361
|
+
return response
|
|
362
|
+
case "melcloudhome":
|
|
363
|
+
response = await this.connectToMelCloudHome();
|
|
364
|
+
return response
|
|
365
|
+
default:
|
|
366
|
+
return response
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
|
|
363
370
|
async send(accountInfo) {
|
|
364
371
|
try {
|
|
365
372
|
const options = { data: accountInfo };
|
package/src/melcloudata.js
CHANGED
|
@@ -237,8 +237,8 @@ class MelCloudAta extends EventEmitter {
|
|
|
237
237
|
}, 500);
|
|
238
238
|
}
|
|
239
239
|
|
|
240
|
-
async send(
|
|
241
|
-
switch (
|
|
240
|
+
async send(accountType, deviceData, displayMode) {
|
|
241
|
+
switch (accountType) {
|
|
242
242
|
case "melcloud":
|
|
243
243
|
try {
|
|
244
244
|
//set target temp based on display mode and operation mode
|
|
@@ -306,41 +306,39 @@ class MelCloudAta extends EventEmitter {
|
|
|
306
306
|
case "melcloudhome":
|
|
307
307
|
try {
|
|
308
308
|
//set target temp based on display mode and operation mode
|
|
309
|
-
let setTemperature = deviceData.Device.SetTemperature;
|
|
310
309
|
switch (displayMode) {
|
|
311
310
|
case 1: //Heather/Cooler
|
|
312
311
|
switch (deviceData.Device.OperationMode) {
|
|
313
312
|
case 1: //HEAT
|
|
314
|
-
|
|
313
|
+
deviceData.Device.SetTemperature = deviceData.Device.DefaultHeatingSetTemperature;
|
|
315
314
|
break;
|
|
316
315
|
case 2: //DRY
|
|
317
|
-
|
|
316
|
+
deviceData.Device.SetTemperature = deviceData.Device.DefaultCoolingSetTemperature;
|
|
318
317
|
break;
|
|
319
318
|
case 3: //COOL
|
|
320
|
-
|
|
319
|
+
deviceData.Device.SetTemperature = deviceData.Device.DefaultCoolingSetTemperature;
|
|
321
320
|
break;
|
|
322
321
|
case 7: //FAN
|
|
323
|
-
|
|
322
|
+
deviceData.Device.SetTemperature = deviceData.Device.SetTemperature;
|
|
324
323
|
break;
|
|
325
324
|
case 8: //AUTO
|
|
326
|
-
|
|
325
|
+
deviceData.Device.SetTemperature = (deviceData.Device.DefaultCoolingSetTemperature + deviceData.Device.DefaultHeatingSetTemperature) / 2;
|
|
327
326
|
break;
|
|
328
327
|
case 9: //HISEE HEAT
|
|
329
|
-
|
|
328
|
+
deviceData.Device.SetTemperature = deviceData.Device.DefaultHeatingSetTemperature;
|
|
330
329
|
break;
|
|
331
330
|
case 10: //ISEE DRY
|
|
332
|
-
|
|
331
|
+
deviceData.Device.SetTemperature = deviceData.Device.DefaultCoolingSetTemperature;
|
|
333
332
|
break;
|
|
334
333
|
case 11: //ISEE COOL
|
|
335
|
-
|
|
334
|
+
deviceData.Device.SetTemperature = deviceData.Device.DefaultCoolingSetTemperature;
|
|
336
335
|
break;
|
|
337
336
|
};
|
|
338
337
|
case 2: //Thermostat
|
|
339
|
-
|
|
338
|
+
deviceData.Device.SetTemperature = deviceData.Device.SetTemperature;
|
|
340
339
|
break;
|
|
341
340
|
};
|
|
342
341
|
|
|
343
|
-
deviceData.Device.SetTemperature = setTemperature;
|
|
344
342
|
deviceData.Device.OperationMode = AirConditioner.OperationModeMapEnumToString[deviceData.Device.OperationMode];
|
|
345
343
|
const payload = {
|
|
346
344
|
data: {
|