homebridge-tasmota-control 1.6.15-beta.16 → 1.6.15-beta.17
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/config.schema.json +40 -10
- package/package.json +1 -1
- package/src/mielhvac.js +27 -24
package/config.schema.json
CHANGED
|
@@ -399,6 +399,12 @@
|
|
|
399
399
|
"type": "string",
|
|
400
400
|
"default": "swing",
|
|
401
401
|
"oneOf": [
|
|
402
|
+
{
|
|
403
|
+
"title": "AIR DIRECTION",
|
|
404
|
+
"enum": [
|
|
405
|
+
"airdirection"
|
|
406
|
+
]
|
|
407
|
+
},
|
|
402
408
|
{
|
|
403
409
|
"title": "LEFT",
|
|
404
410
|
"enum": [
|
|
@@ -411,12 +417,24 @@
|
|
|
411
417
|
"left_middle"
|
|
412
418
|
]
|
|
413
419
|
},
|
|
420
|
+
{
|
|
421
|
+
"title": "LEFT CENTER",
|
|
422
|
+
"enum": [
|
|
423
|
+
"left_center"
|
|
424
|
+
]
|
|
425
|
+
},
|
|
414
426
|
{
|
|
415
427
|
"title": "CENTER",
|
|
416
428
|
"enum": [
|
|
417
429
|
"center"
|
|
418
430
|
]
|
|
419
431
|
},
|
|
432
|
+
{
|
|
433
|
+
"title": "RIGHT CENTER",
|
|
434
|
+
"enum": [
|
|
435
|
+
"right_center"
|
|
436
|
+
]
|
|
437
|
+
},
|
|
420
438
|
{
|
|
421
439
|
"title": "RIGHT MIDDLE",
|
|
422
440
|
"enum": [
|
|
@@ -584,7 +602,7 @@
|
|
|
584
602
|
]
|
|
585
603
|
},
|
|
586
604
|
{
|
|
587
|
-
"title": "VANE H RIGHT",
|
|
605
|
+
"title": "VANE H RIGHT CENTER",
|
|
588
606
|
"enum": [
|
|
589
607
|
14
|
|
590
608
|
]
|
|
@@ -596,7 +614,7 @@
|
|
|
596
614
|
]
|
|
597
615
|
},
|
|
598
616
|
{
|
|
599
|
-
"title": "VANE H RIGHT
|
|
617
|
+
"title": "VANE H RIGHT",
|
|
600
618
|
"enum": [
|
|
601
619
|
16
|
|
602
620
|
]
|
|
@@ -839,25 +857,25 @@
|
|
|
839
857
|
]
|
|
840
858
|
},
|
|
841
859
|
{
|
|
842
|
-
"title": "
|
|
860
|
+
"title": "PURIFY",
|
|
843
861
|
"enum": [
|
|
844
862
|
6
|
|
845
863
|
]
|
|
846
864
|
},
|
|
847
865
|
{
|
|
848
|
-
"title": "VANE H
|
|
866
|
+
"title": "VANE H LEFT",
|
|
849
867
|
"enum": [
|
|
850
868
|
10
|
|
851
869
|
]
|
|
852
870
|
},
|
|
853
871
|
{
|
|
854
|
-
"title": "VANE H LEFT",
|
|
872
|
+
"title": "VANE H LEFT MIDDLE",
|
|
855
873
|
"enum": [
|
|
856
874
|
11
|
|
857
875
|
]
|
|
858
876
|
},
|
|
859
877
|
{
|
|
860
|
-
"title": "VANE H LEFT
|
|
878
|
+
"title": "VANE H LEFT CENTER",
|
|
861
879
|
"enum": [
|
|
862
880
|
12
|
|
863
881
|
]
|
|
@@ -869,29 +887,41 @@
|
|
|
869
887
|
]
|
|
870
888
|
},
|
|
871
889
|
{
|
|
872
|
-
"title": "VANE H RIGHT
|
|
890
|
+
"title": "VANE H RIGHT CENTER",
|
|
873
891
|
"enum": [
|
|
874
892
|
14
|
|
875
893
|
]
|
|
876
894
|
},
|
|
877
895
|
{
|
|
878
|
-
"title": "VANE H RIGHT",
|
|
896
|
+
"title": "VANE H RIGHT MIDDLE",
|
|
879
897
|
"enum": [
|
|
880
898
|
15
|
|
881
899
|
]
|
|
882
900
|
},
|
|
883
901
|
{
|
|
884
|
-
"title": "VANE H
|
|
902
|
+
"title": "VANE H RIGHT",
|
|
885
903
|
"enum": [
|
|
886
904
|
16
|
|
887
905
|
]
|
|
888
906
|
},
|
|
889
907
|
{
|
|
890
|
-
"title": "VANE H
|
|
908
|
+
"title": "VANE H SPLIT",
|
|
891
909
|
"enum": [
|
|
892
910
|
17
|
|
893
911
|
]
|
|
894
912
|
},
|
|
913
|
+
{
|
|
914
|
+
"title": "VANE H SWING",
|
|
915
|
+
"enum": [
|
|
916
|
+
18
|
|
917
|
+
]
|
|
918
|
+
},
|
|
919
|
+
{
|
|
920
|
+
"title": "VANE H AIR DIRECTION",
|
|
921
|
+
"enum": [
|
|
922
|
+
19
|
|
923
|
+
]
|
|
924
|
+
},
|
|
895
925
|
{
|
|
896
926
|
"title": "VANE V AUTO",
|
|
897
927
|
"enum": [
|
package/package.json
CHANGED
package/src/mielhvac.js
CHANGED
|
@@ -484,11 +484,12 @@ class MiElHvac extends EventEmitter {
|
|
|
484
484
|
11: 'left_middle',
|
|
485
485
|
12: 'left_center',
|
|
486
486
|
13: 'center',
|
|
487
|
-
14: '
|
|
487
|
+
14: 'right_center',
|
|
488
488
|
15: 'right_middle',
|
|
489
|
-
16: '
|
|
489
|
+
16: 'right',
|
|
490
490
|
17: 'split',
|
|
491
491
|
18: 'swing',
|
|
492
|
+
19: 'airdirection',
|
|
492
493
|
};
|
|
493
494
|
|
|
494
495
|
const vaneVMap = {
|
|
@@ -511,9 +512,9 @@ class MiElHvac extends EventEmitter {
|
|
|
511
512
|
};
|
|
512
513
|
|
|
513
514
|
const airDirMap = {
|
|
514
|
-
40:
|
|
515
|
-
41:
|
|
516
|
-
42:
|
|
515
|
+
40: 'indirect',
|
|
516
|
+
41: 'direct',
|
|
517
|
+
42: 'even',
|
|
517
518
|
};
|
|
518
519
|
|
|
519
520
|
const prohibitMap = {
|
|
@@ -524,14 +525,14 @@ class MiElHvac extends EventEmitter {
|
|
|
524
525
|
};
|
|
525
526
|
|
|
526
527
|
const purifyMap = {
|
|
527
|
-
60:
|
|
528
|
+
60: 'on',
|
|
528
529
|
};
|
|
529
530
|
|
|
530
531
|
this.buttonsConfigured.forEach((button, index) => {
|
|
531
532
|
const mode = button.mode;
|
|
532
533
|
let state = false;
|
|
533
534
|
|
|
534
|
-
if (modeMap[mode]
|
|
535
|
+
if (modeMap[mode]) {
|
|
535
536
|
state = modeMap[mode]();
|
|
536
537
|
} else if (vaneHMap[mode]) {
|
|
537
538
|
state = power && vaneHorizontalDirection === vaneHMap[mode];
|
|
@@ -540,11 +541,11 @@ class MiElHvac extends EventEmitter {
|
|
|
540
541
|
} else if (fanSpeedMap[mode]) {
|
|
541
542
|
state = power && fanSpeed === fanSpeedMap[mode];
|
|
542
543
|
} else if (airDirMap[mode]) {
|
|
543
|
-
state = airDirMap[mode]
|
|
544
|
-
} else if (prohibitMap[mode]
|
|
545
|
-
state = prohibit === prohibitMap[mode];
|
|
546
|
-
} else if (purifyMap[mode]
|
|
547
|
-
state = purify === purifyMap[mode];
|
|
544
|
+
state = power && airDirMap[mode] === airDirMap[mode];
|
|
545
|
+
} else if (prohibitMap[mode]) {
|
|
546
|
+
state = power && prohibit === prohibitMap[mode];
|
|
547
|
+
} else if (purifyMap[mode]) {
|
|
548
|
+
state = power && purify === purifyMap[mode];
|
|
548
549
|
} else {
|
|
549
550
|
this.emit('warn', `Unknown button mode: ${mode} detected`);
|
|
550
551
|
}
|
|
@@ -576,15 +577,18 @@ class MiElHvac extends EventEmitter {
|
|
|
576
577
|
3: isOneOf(operationMode, ['cool', 'cool_isee']),
|
|
577
578
|
4: is(operationMode, 'fan'),
|
|
578
579
|
5: is(operationMode, 'auto'),
|
|
579
|
-
6: is(
|
|
580
|
+
6: is(purify, 'on'),
|
|
580
581
|
|
|
581
|
-
|
|
582
|
-
|
|
582
|
+
10: is(vaneHorizontalDirection, 'left'),
|
|
583
|
+
11: is(vaneHorizontalDirection, 'left_middle'),
|
|
584
|
+
12: is(vaneHorizontalDirection, 'left_center'),
|
|
583
585
|
13: is(vaneHorizontalDirection, 'center'),
|
|
584
|
-
14: is(vaneHorizontalDirection, '
|
|
585
|
-
15: is(vaneHorizontalDirection, '
|
|
586
|
-
16: is(vaneHorizontalDirection, '
|
|
587
|
-
17: is(vaneHorizontalDirection, '
|
|
586
|
+
14: is(vaneHorizontalDirection, 'right_center'),
|
|
587
|
+
15: is(vaneHorizontalDirection, 'right_middle'),
|
|
588
|
+
16: is(vaneHorizontalDirection, 'right'),
|
|
589
|
+
17: is(vaneHorizontalDirection, 'split'),
|
|
590
|
+
18: is(vaneHorizontalDirection, 'swing'),
|
|
591
|
+
19: is(vaneHorizontalDirection, 'airdirection'),
|
|
588
592
|
|
|
589
593
|
20: is(vaneVerticalDirection, 'auto'),
|
|
590
594
|
21: is(vaneVerticalDirection, 'up'),
|
|
@@ -606,7 +610,6 @@ class MiElHvac extends EventEmitter {
|
|
|
606
610
|
40: is(airDirection, 'indirect'),
|
|
607
611
|
41: is(airDirection, 'direct'),
|
|
608
612
|
42: is(airDirection, 'even'),
|
|
609
|
-
43: powerOn && !['indirect', 'direct', 'even'].includes(airDirection),
|
|
610
613
|
|
|
611
614
|
50: prohibit === 'all',
|
|
612
615
|
51: prohibit === 'power',
|
|
@@ -1070,9 +1073,9 @@ class MiElHvac extends EventEmitter {
|
|
|
1070
1073
|
11: () => getCommand('SetSwingH', 'left_middle'),
|
|
1071
1074
|
12: () => getCommand('SetSwingH', 'left_center'),
|
|
1072
1075
|
13: () => getCommand('SetSwingH', 'center'),
|
|
1073
|
-
14: () => getCommand('SetSwingH', '
|
|
1074
|
-
15: () => getCommand('SetSwingH', '
|
|
1075
|
-
16: () => getCommand('SetSwingH', '
|
|
1076
|
+
14: () => getCommand('SetSwingH', 'right_center'),
|
|
1077
|
+
15: () => getCommand('SetSwingH', 'right_middle'),
|
|
1078
|
+
16: () => getCommand('SetSwingH', 'right'),
|
|
1076
1079
|
17: () => getCommand('SetSwingH', 'split'),
|
|
1077
1080
|
18: () => getCommand('SetSwingH', 'swing'),
|
|
1078
1081
|
|
|
@@ -1233,7 +1236,7 @@ class MiElHvac extends EventEmitter {
|
|
|
1233
1236
|
try {
|
|
1234
1237
|
//check device state
|
|
1235
1238
|
const checkState = await this.checkDeviceState();
|
|
1236
|
-
if(!checkState) return null;
|
|
1239
|
+
if (!checkState) return null;
|
|
1237
1240
|
|
|
1238
1241
|
//connect to deice success
|
|
1239
1242
|
this.emit('success', `Connect Success`)
|