iobroker.zendure-solarflow 1.15.2 → 1.15.3
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/README.md +7 -118
- package/admin/build/index.js +1 -1
- package/admin/build/index.js.map +1 -1
- package/build/constants/hubControlStates.js +9 -0
- package/build/constants/hubControlStates.js.map +2 -2
- package/build/constants/sharedStates.js +7 -0
- package/build/constants/sharedStates.js.map +2 -2
- package/build/main.js +8 -0
- package/build/main.js.map +2 -2
- package/build/models/ISolarFlowMqttProperties.js +1 -0
- package/build/models/ISolarFlowMqttProperties.js.map +2 -2
- package/build/services/mqttService.js +65 -39
- package/build/services/mqttService.js.map +2 -2
- package/io-package.json +27 -27
- package/package.json +3 -3
|
@@ -43,6 +43,7 @@ __export(mqttService_exports, {
|
|
|
43
43
|
setInputLimit: () => setInputLimit,
|
|
44
44
|
setOutputLimit: () => setOutputLimit,
|
|
45
45
|
setPassMode: () => setPassMode,
|
|
46
|
+
setSmartMode: () => setSmartMode,
|
|
46
47
|
subscribeIotTopic: () => subscribeIotTopic,
|
|
47
48
|
subscribeReportTopic: () => subscribeReportTopic,
|
|
48
49
|
triggerFullTelemetryUpdate: () => triggerFullTelemetryUpdate
|
|
@@ -288,7 +289,7 @@ const addOrUpdatePackData = async (productKey, deviceKey, packData, isSolarFlow)
|
|
|
288
289
|
}
|
|
289
290
|
};
|
|
290
291
|
const onMessage = async (topic, message) => {
|
|
291
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q, _R, _S, _T, _U, _V, _W, _X, _Y, _Z, __, _$, _aa, _ba, _ca, _da, _ea, _fa, _ga, _ha, _ia, _ja, _ka, _la, _ma, _na, _oa, _pa, _qa, _ra, _sa, _ta, _ua, _va, _wa, _xa, _ya, _za, _Aa, _Ba, _Ca, _Da, _Ea, _Fa, _Ga, _Ha, _Ia, _Ja, _Ka, _La, _Ma, _Na, _Oa, _Pa, _Qa, _Ra, _Sa, _Ta, _Ua, _Va, _Wa, _Xa, _Ya;
|
|
292
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q, _R, _S, _T, _U, _V, _W, _X, _Y, _Z, __, _$, _aa, _ba, _ca, _da, _ea, _fa, _ga, _ha, _ia, _ja, _ka, _la, _ma, _na, _oa, _pa, _qa, _ra, _sa, _ta, _ua, _va, _wa, _xa, _ya, _za, _Aa, _Ba, _Ca, _Da, _Ea, _Fa, _Ga, _Ha, _Ia, _Ja, _Ka, _La, _Ma, _Na, _Oa, _Pa, _Qa, _Ra, _Sa, _Ta, _Ua, _Va, _Wa, _Xa, _Ya, _Za, __a, _$a;
|
|
292
293
|
if (adapter) {
|
|
293
294
|
if (topic.toLowerCase().includes("loginOut/force")) {
|
|
294
295
|
}
|
|
@@ -468,8 +469,19 @@ const onMessage = async (topic, message) => {
|
|
|
468
469
|
obj.properties.outputLimit
|
|
469
470
|
);
|
|
470
471
|
}
|
|
471
|
-
if (((_F = obj.properties) == null ? void 0 : _F.
|
|
472
|
-
const value = ((_H = obj.properties) == null ? void 0 : _H.
|
|
472
|
+
if (((_F = obj.properties) == null ? void 0 : _F.smartMode) != null && ((_G = obj.properties) == null ? void 0 : _G.smartMode) != void 0) {
|
|
473
|
+
const value = ((_H = obj.properties) == null ? void 0 : _H.smartMode) == 0 ? false : true;
|
|
474
|
+
(0, import_adapterService.updateSolarFlowState)(adapter, productKey, deviceKey, "smartMode", value);
|
|
475
|
+
(0, import_adapterService.updateSolarFlowControlState)(
|
|
476
|
+
adapter,
|
|
477
|
+
productKey,
|
|
478
|
+
deviceKey,
|
|
479
|
+
"smartMode",
|
|
480
|
+
value
|
|
481
|
+
);
|
|
482
|
+
}
|
|
483
|
+
if (((_I = obj.properties) == null ? void 0 : _I.buzzerSwitch) != null && ((_J = obj.properties) == null ? void 0 : _J.buzzerSwitch) != void 0) {
|
|
484
|
+
const value = ((_K = obj.properties) == null ? void 0 : _K.buzzerSwitch) == 0 ? false : true;
|
|
473
485
|
(0, import_adapterService.updateSolarFlowState)(
|
|
474
486
|
adapter,
|
|
475
487
|
productKey,
|
|
@@ -485,7 +497,7 @@ const onMessage = async (topic, message) => {
|
|
|
485
497
|
value
|
|
486
498
|
);
|
|
487
499
|
}
|
|
488
|
-
if (((
|
|
500
|
+
if (((_L = obj.properties) == null ? void 0 : _L.outputPackPower) != null && ((_M = obj.properties) == null ? void 0 : _M.outputPackPower) != void 0) {
|
|
489
501
|
(0, import_adapterService.updateSolarFlowState)(
|
|
490
502
|
adapter,
|
|
491
503
|
productKey,
|
|
@@ -493,7 +505,7 @@ const onMessage = async (topic, message) => {
|
|
|
493
505
|
"outputPackPower",
|
|
494
506
|
obj.properties.outputPackPower
|
|
495
507
|
);
|
|
496
|
-
if (((
|
|
508
|
+
if (((_N = obj.properties) == null ? void 0 : _N.outputPackPower) > 0) {
|
|
497
509
|
(0, import_adapterService.updateSolarFlowState)(
|
|
498
510
|
adapter,
|
|
499
511
|
productKey,
|
|
@@ -501,7 +513,7 @@ const onMessage = async (topic, message) => {
|
|
|
501
513
|
"packPower",
|
|
502
514
|
obj.properties.outputPackPower
|
|
503
515
|
);
|
|
504
|
-
} else if (((
|
|
516
|
+
} else if (((_O = obj.properties) == null ? void 0 : _O.outputPackPower) == 0) {
|
|
505
517
|
const packInputPower = await (adapter == null ? void 0 : adapter.getStateAsync(
|
|
506
518
|
productKey + "." + deviceKey + ".packInputPower"
|
|
507
519
|
));
|
|
@@ -517,7 +529,7 @@ const onMessage = async (topic, message) => {
|
|
|
517
529
|
}
|
|
518
530
|
(0, import_adapterService.updateSolarFlowState)(adapter, productKey, deviceKey, "packInputPower", 0);
|
|
519
531
|
}
|
|
520
|
-
if (((
|
|
532
|
+
if (((_P = obj.properties) == null ? void 0 : _P.packInputPower) != null && ((_Q = obj.properties) == null ? void 0 : _Q.packInputPower) != void 0) {
|
|
521
533
|
(0, import_adapterService.updateSolarFlowState)(
|
|
522
534
|
adapter,
|
|
523
535
|
productKey,
|
|
@@ -525,7 +537,7 @@ const onMessage = async (topic, message) => {
|
|
|
525
537
|
"packInputPower",
|
|
526
538
|
obj.properties.packInputPower
|
|
527
539
|
);
|
|
528
|
-
if (((
|
|
540
|
+
if (((_R = obj.properties) == null ? void 0 : _R.packInputPower) > 0) {
|
|
529
541
|
(0, import_adapterService.updateSolarFlowState)(
|
|
530
542
|
adapter,
|
|
531
543
|
productKey,
|
|
@@ -533,7 +545,7 @@ const onMessage = async (topic, message) => {
|
|
|
533
545
|
"packPower",
|
|
534
546
|
-Math.abs(obj.properties.packInputPower)
|
|
535
547
|
);
|
|
536
|
-
} else if (((
|
|
548
|
+
} else if (((_S = obj.properties) == null ? void 0 : _S.packInputPower) == 0) {
|
|
537
549
|
const outputPackPower = await (adapter == null ? void 0 : adapter.getStateAsync(
|
|
538
550
|
productKey + "." + deviceKey + ".outputPackPower"
|
|
539
551
|
));
|
|
@@ -555,7 +567,7 @@ const onMessage = async (topic, message) => {
|
|
|
555
567
|
0
|
|
556
568
|
);
|
|
557
569
|
}
|
|
558
|
-
if (((
|
|
570
|
+
if (((_T = obj.properties) == null ? void 0 : _T.solarInputPower) != null && ((_U = obj.properties) == null ? void 0 : _U.solarInputPower) != void 0) {
|
|
559
571
|
(0, import_adapterService.updateSolarFlowState)(
|
|
560
572
|
adapter,
|
|
561
573
|
productKey,
|
|
@@ -564,7 +576,7 @@ const onMessage = async (topic, message) => {
|
|
|
564
576
|
obj.properties.solarInputPower
|
|
565
577
|
);
|
|
566
578
|
}
|
|
567
|
-
if (((
|
|
579
|
+
if (((_V = obj.properties) == null ? void 0 : _V.pvPower1) != null && ((_W = obj.properties) == null ? void 0 : _W.pvPower1) != void 0) {
|
|
568
580
|
(0, import_adapterService.updateSolarFlowState)(
|
|
569
581
|
adapter,
|
|
570
582
|
productKey,
|
|
@@ -574,7 +586,7 @@ const onMessage = async (topic, message) => {
|
|
|
574
586
|
obj.properties.pvPower1
|
|
575
587
|
);
|
|
576
588
|
}
|
|
577
|
-
if (((
|
|
589
|
+
if (((_X = obj.properties) == null ? void 0 : _X.pvPower2) != null && ((_Y = obj.properties) == null ? void 0 : _Y.pvPower2) != void 0) {
|
|
578
590
|
(0, import_adapterService.updateSolarFlowState)(
|
|
579
591
|
adapter,
|
|
580
592
|
productKey,
|
|
@@ -584,7 +596,7 @@ const onMessage = async (topic, message) => {
|
|
|
584
596
|
obj.properties.pvPower2
|
|
585
597
|
);
|
|
586
598
|
}
|
|
587
|
-
if (((
|
|
599
|
+
if (((_Z = obj.properties) == null ? void 0 : _Z.solarPower1) != null && ((__ = obj.properties) == null ? void 0 : __.solarPower1) != void 0) {
|
|
588
600
|
(0, import_adapterService.updateSolarFlowState)(
|
|
589
601
|
adapter,
|
|
590
602
|
productKey,
|
|
@@ -593,7 +605,7 @@ const onMessage = async (topic, message) => {
|
|
|
593
605
|
obj.properties.solarPower1
|
|
594
606
|
);
|
|
595
607
|
}
|
|
596
|
-
if (((
|
|
608
|
+
if (((_$ = obj.properties) == null ? void 0 : _$.solarPower2) != null && ((_aa = obj.properties) == null ? void 0 : _aa.solarPower2) != void 0) {
|
|
597
609
|
(0, import_adapterService.updateSolarFlowState)(
|
|
598
610
|
adapter,
|
|
599
611
|
productKey,
|
|
@@ -602,7 +614,7 @@ const onMessage = async (topic, message) => {
|
|
|
602
614
|
obj.properties.solarPower2
|
|
603
615
|
);
|
|
604
616
|
}
|
|
605
|
-
if (((
|
|
617
|
+
if (((_ba = obj.properties) == null ? void 0 : _ba.solarPower3) != null && ((_ca = obj.properties) == null ? void 0 : _ca.solarPower3) != void 0) {
|
|
606
618
|
(0, import_adapterService.updateSolarFlowState)(
|
|
607
619
|
adapter,
|
|
608
620
|
productKey,
|
|
@@ -611,7 +623,7 @@ const onMessage = async (topic, message) => {
|
|
|
611
623
|
obj.properties.solarPower3
|
|
612
624
|
);
|
|
613
625
|
}
|
|
614
|
-
if (((
|
|
626
|
+
if (((_da = obj.properties) == null ? void 0 : _da.solarPower4) != null && ((_ea = obj.properties) == null ? void 0 : _ea.solarPower4) != void 0) {
|
|
615
627
|
(0, import_adapterService.updateSolarFlowState)(
|
|
616
628
|
adapter,
|
|
617
629
|
productKey,
|
|
@@ -620,7 +632,7 @@ const onMessage = async (topic, message) => {
|
|
|
620
632
|
obj.properties.solarPower4
|
|
621
633
|
);
|
|
622
634
|
}
|
|
623
|
-
if (((
|
|
635
|
+
if (((_fa = obj.properties) == null ? void 0 : _fa.remainOutTime) != null && ((_ga = obj.properties) == null ? void 0 : _ga.remainOutTime) != void 0) {
|
|
624
636
|
(0, import_adapterService.updateSolarFlowState)(
|
|
625
637
|
adapter,
|
|
626
638
|
productKey,
|
|
@@ -629,7 +641,7 @@ const onMessage = async (topic, message) => {
|
|
|
629
641
|
obj.properties.remainOutTime
|
|
630
642
|
);
|
|
631
643
|
}
|
|
632
|
-
if (((
|
|
644
|
+
if (((_ha = obj.properties) == null ? void 0 : _ha.remainInputTime) != null && ((_ia = obj.properties) == null ? void 0 : _ia.remainInputTime) != void 0) {
|
|
633
645
|
(0, import_adapterService.updateSolarFlowState)(
|
|
634
646
|
adapter,
|
|
635
647
|
productKey,
|
|
@@ -638,7 +650,7 @@ const onMessage = async (topic, message) => {
|
|
|
638
650
|
obj.properties.remainInputTime
|
|
639
651
|
);
|
|
640
652
|
}
|
|
641
|
-
if (((
|
|
653
|
+
if (((_ja = obj.properties) == null ? void 0 : _ja.socSet) != null && ((_ka = obj.properties) == null ? void 0 : _ka.socSet) != void 0) {
|
|
642
654
|
(0, import_adapterService.updateSolarFlowState)(
|
|
643
655
|
adapter,
|
|
644
656
|
productKey,
|
|
@@ -654,7 +666,7 @@ const onMessage = async (topic, message) => {
|
|
|
654
666
|
Number(obj.properties.socSet) / 10
|
|
655
667
|
);
|
|
656
668
|
}
|
|
657
|
-
if (((
|
|
669
|
+
if (((_la = obj.properties) == null ? void 0 : _la.minSoc) != null && ((_ma = obj.properties) == null ? void 0 : _ma.minSoc) != void 0) {
|
|
658
670
|
(0, import_adapterService.updateSolarFlowState)(
|
|
659
671
|
adapter,
|
|
660
672
|
productKey,
|
|
@@ -670,7 +682,7 @@ const onMessage = async (topic, message) => {
|
|
|
670
682
|
Number(obj.properties.minSoc) / 10
|
|
671
683
|
);
|
|
672
684
|
}
|
|
673
|
-
if (((
|
|
685
|
+
if (((_na = obj.properties) == null ? void 0 : _na.inputLimit) != null && ((_oa = obj.properties) == null ? void 0 : _oa.inputLimit) != void 0) {
|
|
674
686
|
(0, import_adapterService.updateSolarFlowState)(
|
|
675
687
|
adapter,
|
|
676
688
|
productKey,
|
|
@@ -678,7 +690,7 @@ const onMessage = async (topic, message) => {
|
|
|
678
690
|
"inputLimit",
|
|
679
691
|
obj.properties.inputLimit
|
|
680
692
|
);
|
|
681
|
-
if (((
|
|
693
|
+
if (((_pa = productName == null ? void 0 : productName.val) == null ? void 0 : _pa.toString().toLowerCase().includes("solarflow")) || ((_qa = productName == null ? void 0 : productName.val) == null ? void 0 : _qa.toString().toLowerCase().includes("ace")) || ((_ra = productName == null ? void 0 : productName.val) == null ? void 0 : _ra.toString().toLowerCase().includes("hyper"))) {
|
|
682
694
|
(0, import_adapterService.updateSolarFlowControlState)(
|
|
683
695
|
adapter,
|
|
684
696
|
productKey,
|
|
@@ -688,7 +700,7 @@ const onMessage = async (topic, message) => {
|
|
|
688
700
|
);
|
|
689
701
|
}
|
|
690
702
|
}
|
|
691
|
-
if (((
|
|
703
|
+
if (((_sa = obj.properties) == null ? void 0 : _sa.gridInputPower) != null && ((_ta = obj.properties) == null ? void 0 : _ta.gridInputPower) != void 0) {
|
|
692
704
|
(0, import_adapterService.updateSolarFlowState)(
|
|
693
705
|
adapter,
|
|
694
706
|
productKey,
|
|
@@ -697,7 +709,7 @@ const onMessage = async (topic, message) => {
|
|
|
697
709
|
obj.properties.gridInputPower
|
|
698
710
|
);
|
|
699
711
|
}
|
|
700
|
-
if (((
|
|
712
|
+
if (((_ua = obj.properties) == null ? void 0 : _ua.acMode) != null && ((_va = obj.properties) == null ? void 0 : _va.acMode) != void 0) {
|
|
701
713
|
(0, import_adapterService.updateSolarFlowState)(
|
|
702
714
|
adapter,
|
|
703
715
|
productKey,
|
|
@@ -713,7 +725,7 @@ const onMessage = async (topic, message) => {
|
|
|
713
725
|
obj.properties.acMode
|
|
714
726
|
);
|
|
715
727
|
}
|
|
716
|
-
if (((
|
|
728
|
+
if (((_wa = obj.properties) == null ? void 0 : _wa.hyperTmp) != null && ((_xa = obj.properties) == null ? void 0 : _xa.hyperTmp) != void 0) {
|
|
717
729
|
(0, import_adapterService.updateSolarFlowState)(
|
|
718
730
|
adapter,
|
|
719
731
|
productKey,
|
|
@@ -722,7 +734,7 @@ const onMessage = async (topic, message) => {
|
|
|
722
734
|
obj.properties.hyperTmp / 10 - 273.15
|
|
723
735
|
);
|
|
724
736
|
}
|
|
725
|
-
if (((
|
|
737
|
+
if (((_ya = obj.properties) == null ? void 0 : _ya.acOutputPower) != null && ((_za = obj.properties) == null ? void 0 : _za.acOutputPower) != void 0) {
|
|
726
738
|
(0, import_adapterService.updateSolarFlowState)(
|
|
727
739
|
adapter,
|
|
728
740
|
productKey,
|
|
@@ -731,7 +743,7 @@ const onMessage = async (topic, message) => {
|
|
|
731
743
|
obj.properties.acOutputPower
|
|
732
744
|
);
|
|
733
745
|
}
|
|
734
|
-
if (((
|
|
746
|
+
if (((_Aa = obj.properties) == null ? void 0 : _Aa.gridPower) != null && ((_Ba = obj.properties) == null ? void 0 : _Ba.gridPower) != void 0) {
|
|
735
747
|
(0, import_adapterService.updateSolarFlowState)(
|
|
736
748
|
adapter,
|
|
737
749
|
productKey,
|
|
@@ -740,8 +752,8 @@ const onMessage = async (topic, message) => {
|
|
|
740
752
|
obj.properties.gridPower
|
|
741
753
|
);
|
|
742
754
|
}
|
|
743
|
-
if (((
|
|
744
|
-
const value = ((
|
|
755
|
+
if (((_Ca = obj.properties) == null ? void 0 : _Ca.acSwitch) != null && ((_Da = obj.properties) == null ? void 0 : _Da.acSwitch) != void 0) {
|
|
756
|
+
const value = ((_Ea = obj.properties) == null ? void 0 : _Ea.acSwitch) == 0 ? false : true;
|
|
745
757
|
(0, import_adapterService.updateSolarFlowState)(adapter, productKey, deviceKey, "acSwitch", value);
|
|
746
758
|
(0, import_adapterService.updateSolarFlowControlState)(
|
|
747
759
|
adapter,
|
|
@@ -751,8 +763,8 @@ const onMessage = async (topic, message) => {
|
|
|
751
763
|
value
|
|
752
764
|
);
|
|
753
765
|
}
|
|
754
|
-
if (((
|
|
755
|
-
const value = ((
|
|
766
|
+
if (((_Fa = obj.properties) == null ? void 0 : _Fa.dcSwitch) != null && ((_Ga = obj.properties) == null ? void 0 : _Ga.dcSwitch) != void 0) {
|
|
767
|
+
const value = ((_Ha = obj.properties) == null ? void 0 : _Ha.dcSwitch) == 0 ? false : true;
|
|
756
768
|
(0, import_adapterService.updateSolarFlowState)(adapter, productKey, deviceKey, "dcSwitch", value);
|
|
757
769
|
(0, import_adapterService.updateSolarFlowControlState)(
|
|
758
770
|
adapter,
|
|
@@ -762,7 +774,7 @@ const onMessage = async (topic, message) => {
|
|
|
762
774
|
value
|
|
763
775
|
);
|
|
764
776
|
}
|
|
765
|
-
if (((
|
|
777
|
+
if (((_Ia = obj.properties) == null ? void 0 : _Ia.dcOutputPower) != null && ((_Ja = obj.properties) == null ? void 0 : _Ja.dcOutputPower) != void 0) {
|
|
766
778
|
(0, import_adapterService.updateSolarFlowState)(
|
|
767
779
|
adapter,
|
|
768
780
|
productKey,
|
|
@@ -771,11 +783,11 @@ const onMessage = async (topic, message) => {
|
|
|
771
783
|
obj.properties.dcOutputPower
|
|
772
784
|
);
|
|
773
785
|
}
|
|
774
|
-
if (((
|
|
775
|
-
const value = ((
|
|
786
|
+
if (((_Ka = obj.properties) == null ? void 0 : _Ka.pvBrand) != null && ((_La = obj.properties) == null ? void 0 : _La.pvBrand) != void 0) {
|
|
787
|
+
const value = ((_Ma = obj.properties) == null ? void 0 : _Ma.pvBrand) == 0 ? "Others" : ((_Na = obj.properties) == null ? void 0 : _Na.pvBrand) == 1 ? "Hoymiles" : ((_Oa = obj.properties) == null ? void 0 : _Oa.pvBrand) == 2 ? "Enphase" : ((_Pa = obj.properties) == null ? void 0 : _Pa.pvBrand) == 3 ? "APSystems" : ((_Qa = obj.properties) == null ? void 0 : _Qa.pvBrand) == 4 ? "Anker" : ((_Ra = obj.properties) == null ? void 0 : _Ra.pvBrand) == 5 ? "Deye" : ((_Sa = obj.properties) == null ? void 0 : _Sa.pvBrand) == 6 ? "Bosswerk" : "Unknown";
|
|
776
788
|
(0, import_adapterService.updateSolarFlowState)(adapter, productKey, deviceKey, "pvBrand", value);
|
|
777
789
|
}
|
|
778
|
-
if (((
|
|
790
|
+
if (((_Ta = obj.properties) == null ? void 0 : _Ta.inverseMaxPower) != null && ((_Ua = obj.properties) == null ? void 0 : _Ua.inverseMaxPower) != void 0) {
|
|
779
791
|
(0, import_adapterService.updateSolarFlowState)(
|
|
780
792
|
adapter,
|
|
781
793
|
productKey,
|
|
@@ -784,7 +796,7 @@ const onMessage = async (topic, message) => {
|
|
|
784
796
|
obj.properties.inverseMaxPower
|
|
785
797
|
);
|
|
786
798
|
}
|
|
787
|
-
if (((
|
|
799
|
+
if (((_Va = obj.properties) == null ? void 0 : _Va.wifiState) != null && ((_Wa = obj.properties) == null ? void 0 : _Wa.wifiState) != void 0) {
|
|
788
800
|
(0, import_adapterService.updateSolarFlowState)(
|
|
789
801
|
adapter,
|
|
790
802
|
productKey,
|
|
@@ -793,7 +805,7 @@ const onMessage = async (topic, message) => {
|
|
|
793
805
|
obj.properties.wifiState == 1 ? "Connected" : "Disconnected"
|
|
794
806
|
);
|
|
795
807
|
}
|
|
796
|
-
if (((
|
|
808
|
+
if (((_Xa = obj.properties) == null ? void 0 : _Xa.packNum) != null && ((_Ya = obj.properties) == null ? void 0 : _Ya.packNum) != void 0) {
|
|
797
809
|
(0, import_adapterService.updateSolarFlowState)(
|
|
798
810
|
adapter,
|
|
799
811
|
productKey,
|
|
@@ -802,7 +814,7 @@ const onMessage = async (topic, message) => {
|
|
|
802
814
|
obj.properties.packNum
|
|
803
815
|
);
|
|
804
816
|
}
|
|
805
|
-
if (((
|
|
817
|
+
if (((_Za = obj.properties) == null ? void 0 : _Za.hubState) != null && ((__a = obj.properties) == null ? void 0 : __a.hubState) != void 0) {
|
|
806
818
|
(0, import_adapterService.updateSolarFlowState)(
|
|
807
819
|
adapter,
|
|
808
820
|
productKey,
|
|
@@ -822,7 +834,7 @@ const onMessage = async (topic, message) => {
|
|
|
822
834
|
addOrUpdatePackData(productKey, deviceKey, obj.packData, isSolarFlow);
|
|
823
835
|
}
|
|
824
836
|
if (obj.properties && adapter.log.level == "debug") {
|
|
825
|
-
const _productName = (
|
|
837
|
+
const _productName = (_$a = productName == null ? void 0 : productName.val) == null ? void 0 : _$a.toString();
|
|
826
838
|
if (_productName) {
|
|
827
839
|
const states = (0, import_createSolarFlowStates.getStateDefinition)(_productName);
|
|
828
840
|
let found = false;
|
|
@@ -1034,6 +1046,19 @@ const setInputLimit = async (adapter2, productKey, deviceKey, limit) => {
|
|
|
1034
1046
|
}
|
|
1035
1047
|
}
|
|
1036
1048
|
};
|
|
1049
|
+
const setSmartMode = async (adapter2, productKey, deviceKey, smartModeOn) => {
|
|
1050
|
+
var _a;
|
|
1051
|
+
if (adapter2.mqttClient && productKey && deviceKey) {
|
|
1052
|
+
const topic = `iot/${productKey}/${deviceKey}/properties/write`;
|
|
1053
|
+
const setSmartModeContent = {
|
|
1054
|
+
properties: { smartMode: smartModeOn ? 1 : 0 }
|
|
1055
|
+
};
|
|
1056
|
+
adapter2.log.debug(
|
|
1057
|
+
`[setBuzzer] Setting Smart Mode for device key ${deviceKey} to ${smartModeOn}!`
|
|
1058
|
+
);
|
|
1059
|
+
(_a = adapter2.mqttClient) == null ? void 0 : _a.publish(topic, JSON.stringify(setSmartModeContent));
|
|
1060
|
+
}
|
|
1061
|
+
};
|
|
1037
1062
|
const setBuzzerSwitch = async (adapter2, productKey, deviceKey, buzzerOn) => {
|
|
1038
1063
|
var _a;
|
|
1039
1064
|
if (adapter2.mqttClient && productKey && deviceKey) {
|
|
@@ -1376,6 +1401,7 @@ const connectLocalMqttClient = (_adapter) => {
|
|
|
1376
1401
|
setInputLimit,
|
|
1377
1402
|
setOutputLimit,
|
|
1378
1403
|
setPassMode,
|
|
1404
|
+
setSmartMode,
|
|
1379
1405
|
subscribeIotTopic,
|
|
1380
1406
|
subscribeReportTopic,
|
|
1381
1407
|
triggerFullTelemetryUpdate
|