homebridge-melcloud-control 2.5.0-beta.73 → 2.5.0-beta.76
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 +49 -27
- package/homebridge-ui/public/index.html +64 -54
- package/index.js +102 -113
- package/package.json +1 -1
- package/src/deviceata.js +10 -10
- package/src/deviceatw.js +14 -14
- package/src/deviceerv.js +8 -8
- package/src/melcloud.js +4 -6
package/config.schema.json
CHANGED
|
@@ -229,7 +229,8 @@
|
|
|
229
229
|
"title": "Control",
|
|
230
230
|
"type": "integer",
|
|
231
231
|
"minimum": 0,
|
|
232
|
-
"maximum":
|
|
232
|
+
"maximum": 1,
|
|
233
|
+
"default": 0,
|
|
233
234
|
"oneOf": [
|
|
234
235
|
{
|
|
235
236
|
"title": "None/Disabled",
|
|
@@ -251,13 +252,14 @@
|
|
|
251
252
|
}
|
|
252
253
|
],
|
|
253
254
|
"description": "Select device control mode displayed in HomeKit app.",
|
|
254
|
-
"required":
|
|
255
|
+
"required": true
|
|
255
256
|
},
|
|
256
257
|
"heatDryFanMode": {
|
|
257
258
|
"title": "Heat",
|
|
258
259
|
"type": "integer",
|
|
259
260
|
"minimum": 0,
|
|
260
261
|
"maximum": 3,
|
|
262
|
+
"default": 1,
|
|
261
263
|
"oneOf": [
|
|
262
264
|
{
|
|
263
265
|
"title": "None/Disabled",
|
|
@@ -285,7 +287,7 @@
|
|
|
285
287
|
}
|
|
286
288
|
],
|
|
287
289
|
"description": "Select the operating mode for Heat, if this mode is not supported, it will be disabled.",
|
|
288
|
-
"required":
|
|
290
|
+
"required": true
|
|
289
291
|
},
|
|
290
292
|
"coolDryFanMode": {
|
|
291
293
|
"title": "Cool",
|
|
@@ -319,13 +321,14 @@
|
|
|
319
321
|
}
|
|
320
322
|
],
|
|
321
323
|
"description": "Select the operating mode for Cool, if this mode is not supported, it will be disabled.",
|
|
322
|
-
"required":
|
|
324
|
+
"required": true
|
|
323
325
|
},
|
|
324
326
|
"autoDryFanMode": {
|
|
325
327
|
"title": "Auto",
|
|
326
328
|
"type": "integer",
|
|
327
329
|
"minimum": 0,
|
|
328
330
|
"maximum": 3,
|
|
331
|
+
"default": 1,
|
|
329
332
|
"oneOf": [
|
|
330
333
|
{
|
|
331
334
|
"title": "None/Disabled",
|
|
@@ -353,23 +356,26 @@
|
|
|
353
356
|
}
|
|
354
357
|
],
|
|
355
358
|
"description": "Select the operating mode for Auto, if this mode is not supported, it will be disabled.",
|
|
356
|
-
"required":
|
|
359
|
+
"required": true
|
|
357
360
|
},
|
|
358
361
|
"presets": {
|
|
359
362
|
"title": "Presets",
|
|
360
363
|
"type": "boolean",
|
|
364
|
+
"default": false,
|
|
361
365
|
"description": "This enable extra buttons for configured presets and display it in HomeKit app.",
|
|
362
366
|
"required": false
|
|
363
367
|
},
|
|
364
368
|
"temperatureSensor": {
|
|
365
369
|
"title": "Room",
|
|
366
370
|
"type": "boolean",
|
|
371
|
+
"default": false,
|
|
367
372
|
"description": "This enable extra room temperature sensor to use with automations in HomeKit app.",
|
|
368
373
|
"required": false
|
|
369
374
|
},
|
|
370
375
|
"temperatureSensorOutdoor": {
|
|
371
376
|
"title": "Outdoor",
|
|
372
377
|
"type": "boolean",
|
|
378
|
+
"default": false,
|
|
373
379
|
"description": "This enable extra outdoor temperature sensor to use with automations in HomeKit app.",
|
|
374
380
|
"required": false
|
|
375
381
|
},
|
|
@@ -384,7 +390,7 @@
|
|
|
384
390
|
"type": "string",
|
|
385
391
|
"placeholder": "Button name",
|
|
386
392
|
"description": "Your own name displayed in Homebridge/HomeKit app.",
|
|
387
|
-
"required":
|
|
393
|
+
"required": true
|
|
388
394
|
},
|
|
389
395
|
"mode": {
|
|
390
396
|
"title": "Mode",
|
|
@@ -604,13 +610,14 @@
|
|
|
604
610
|
]
|
|
605
611
|
}
|
|
606
612
|
],
|
|
607
|
-
"required":
|
|
613
|
+
"required": true
|
|
608
614
|
},
|
|
609
615
|
"displayType": {
|
|
610
616
|
"title": "Type",
|
|
611
617
|
"type": "integer",
|
|
612
618
|
"minimum": 0,
|
|
613
619
|
"maximum": 5,
|
|
620
|
+
"default": 0,
|
|
614
621
|
"oneOf": [
|
|
615
622
|
{
|
|
616
623
|
"title": "None/Disabled",
|
|
@@ -650,21 +657,20 @@
|
|
|
650
657
|
}
|
|
651
658
|
],
|
|
652
659
|
"description": "Select the characteristic type to be displayed in HomeKit app.",
|
|
653
|
-
"required":
|
|
660
|
+
"required": true
|
|
654
661
|
},
|
|
655
662
|
"namePrefix": {
|
|
656
663
|
"title": "Prefix",
|
|
657
664
|
"type": "boolean",
|
|
665
|
+
"default": false,
|
|
658
666
|
"description": "Enable/disable the accessory name as a prefix for button/sensor name.",
|
|
659
667
|
"required": false
|
|
660
668
|
}
|
|
661
669
|
}
|
|
662
|
-
}
|
|
663
|
-
"required": false
|
|
670
|
+
}
|
|
664
671
|
}
|
|
665
672
|
}
|
|
666
|
-
}
|
|
667
|
-
"required": false
|
|
673
|
+
}
|
|
668
674
|
},
|
|
669
675
|
"atwDevices": {
|
|
670
676
|
"title": "Devices ATW",
|
|
@@ -692,6 +698,7 @@
|
|
|
692
698
|
"type": "integer",
|
|
693
699
|
"minimum": 0,
|
|
694
700
|
"maximum": 2,
|
|
701
|
+
"default": 1,
|
|
695
702
|
"oneOf": [
|
|
696
703
|
{
|
|
697
704
|
"title": "None/Disabled",
|
|
@@ -713,65 +720,75 @@
|
|
|
713
720
|
}
|
|
714
721
|
],
|
|
715
722
|
"description": "Select device control mode displayed in HomeKit app.",
|
|
716
|
-
"required":
|
|
723
|
+
"required": true
|
|
717
724
|
},
|
|
718
725
|
"temperatureSensor": {
|
|
719
726
|
"title": "Temperature Sensor Room",
|
|
720
727
|
"type": "boolean",
|
|
728
|
+
"default": false,
|
|
721
729
|
"description": "This enable extra temperature sensor to use with automations in HomeKit app.",
|
|
722
730
|
"required": false
|
|
723
731
|
},
|
|
724
732
|
"temperatureSensorFlow": {
|
|
725
733
|
"title": "Temperature Sensor Flow",
|
|
726
734
|
"type": "boolean",
|
|
735
|
+
"default": false,
|
|
727
736
|
"description": "This enable extra Flow temperature sensor to use with automations in HomeKit app.",
|
|
728
737
|
"required": false
|
|
729
738
|
},
|
|
730
739
|
"temperatureSensorReturn": {
|
|
731
740
|
"title": "Temperature Sensor Return",
|
|
732
741
|
"type": "boolean",
|
|
742
|
+
"default": false,
|
|
733
743
|
"description": "This enable extra Return temperature sensor to use with automations in HomeKit app.",
|
|
734
744
|
"required": false
|
|
735
745
|
},
|
|
736
746
|
"temperatureSensorFlowZone1": {
|
|
737
747
|
"title": "Temperature Sensor Flow Zone 1",
|
|
738
748
|
"type": "boolean",
|
|
749
|
+
"default": false,
|
|
739
750
|
"description": "This enable extra Flow Zone 1 temperature sensor to use with automations in HomeKit app.",
|
|
740
751
|
"required": false
|
|
741
752
|
},
|
|
742
753
|
"temperatureSensorReturnZone1": {
|
|
743
754
|
"title": "Temperature Sensor Return Zone 1",
|
|
744
755
|
"type": "boolean",
|
|
756
|
+
"default": false,
|
|
745
757
|
"description": "This enable extra Return Zone 1 temperature sensor to use with automations in HomeKit app.",
|
|
746
758
|
"required": false
|
|
747
759
|
},
|
|
748
760
|
"temperatureSensorFlowWaterTank": {
|
|
749
761
|
"title": "Temperature Sensor Flow Water Tank",
|
|
750
762
|
"type": "boolean",
|
|
763
|
+
"default": false,
|
|
751
764
|
"description": "This enable extra Flow Water Tank temperature sensor to use with automations in HomeKit app.",
|
|
752
765
|
"required": false
|
|
753
766
|
},
|
|
754
767
|
"temperatureSensorReturnWaterTank": {
|
|
755
768
|
"title": "Temperature Sensor Return Water Tank",
|
|
756
769
|
"type": "boolean",
|
|
770
|
+
"default": false,
|
|
757
771
|
"description": "This enable extra Return Water Tank temperature sensor to use with automations in HomeKit app.",
|
|
758
772
|
"required": false
|
|
759
773
|
},
|
|
760
774
|
"temperatureSensorFlowZone2": {
|
|
761
775
|
"title": "Temperature Sensor Flow Zone 2",
|
|
762
776
|
"type": "boolean",
|
|
777
|
+
"default": false,
|
|
763
778
|
"description": "This enable extra Flow Zone 2 temperature sensor to use with automations in HomeKit app.",
|
|
764
779
|
"required": false
|
|
765
780
|
},
|
|
766
781
|
"temperatureSensorReturnZone2": {
|
|
767
782
|
"title": "Temperature Sensor Return Zone 2",
|
|
768
783
|
"type": "boolean",
|
|
784
|
+
"default": false,
|
|
769
785
|
"description": "This enable extra Return Zone 2 temperature sensor to use with automations in HomeKit app.",
|
|
770
786
|
"required": false
|
|
771
787
|
},
|
|
772
788
|
"presets": {
|
|
773
789
|
"title": "Presets",
|
|
774
790
|
"type": "boolean",
|
|
791
|
+
"default": false,
|
|
775
792
|
"description": "This enable extra buttons for configured presets and display it in HomeKit app.",
|
|
776
793
|
"required": false
|
|
777
794
|
},
|
|
@@ -786,7 +803,7 @@
|
|
|
786
803
|
"type": "string",
|
|
787
804
|
"placeholder": "Button name",
|
|
788
805
|
"description": "Your own name displayed in Homebridge/HomeKit app.",
|
|
789
|
-
"required":
|
|
806
|
+
"required": true
|
|
790
807
|
},
|
|
791
808
|
"mode": {
|
|
792
809
|
"title": "Mode",
|
|
@@ -928,13 +945,14 @@
|
|
|
928
945
|
]
|
|
929
946
|
}
|
|
930
947
|
],
|
|
931
|
-
"required":
|
|
948
|
+
"required": true
|
|
932
949
|
},
|
|
933
950
|
"displayType": {
|
|
934
951
|
"title": "Type",
|
|
935
952
|
"type": "integer",
|
|
936
953
|
"minimum": 0,
|
|
937
954
|
"maximum": 5,
|
|
955
|
+
"default": 0,
|
|
938
956
|
"oneOf": [
|
|
939
957
|
{
|
|
940
958
|
"title": "None/Disabled",
|
|
@@ -974,21 +992,20 @@
|
|
|
974
992
|
}
|
|
975
993
|
],
|
|
976
994
|
"description": "Select the characteristic type to be displayed in HomeKit app.",
|
|
977
|
-
"required":
|
|
995
|
+
"required": true
|
|
978
996
|
},
|
|
979
997
|
"namePrefix": {
|
|
980
998
|
"title": "Prefix",
|
|
981
999
|
"type": "boolean",
|
|
1000
|
+
"default": false,
|
|
982
1001
|
"description": "Enable/disable the accessory name as a prefix for button/sensor name.",
|
|
983
1002
|
"required": false
|
|
984
1003
|
}
|
|
985
1004
|
}
|
|
986
|
-
}
|
|
987
|
-
"required": false
|
|
1005
|
+
}
|
|
988
1006
|
}
|
|
989
1007
|
}
|
|
990
|
-
}
|
|
991
|
-
"required": false
|
|
1008
|
+
}
|
|
992
1009
|
},
|
|
993
1010
|
"ervDevices": {
|
|
994
1011
|
"title": "Devices ERV",
|
|
@@ -1016,6 +1033,7 @@
|
|
|
1016
1033
|
"type": "integer",
|
|
1017
1034
|
"minimum": 0,
|
|
1018
1035
|
"maximum": 2,
|
|
1036
|
+
"default": 0,
|
|
1019
1037
|
"oneOf": [
|
|
1020
1038
|
{
|
|
1021
1039
|
"title": "None/Disabled",
|
|
@@ -1042,24 +1060,28 @@
|
|
|
1042
1060
|
"temperatureSensor": {
|
|
1043
1061
|
"title": "Temperature Sensor Room",
|
|
1044
1062
|
"type": "boolean",
|
|
1063
|
+
"default": false,
|
|
1045
1064
|
"description": "This enable extra temperature sensor to use with automations in HomeKit app.",
|
|
1046
1065
|
"required": false
|
|
1047
1066
|
},
|
|
1048
1067
|
"temperatureSensorOutdoor": {
|
|
1049
1068
|
"title": "Temperature Sensor Outdoor",
|
|
1050
1069
|
"type": "boolean",
|
|
1070
|
+
"default": false,
|
|
1051
1071
|
"description": "This enable extra outdoor temperature sensor to use with automations in HomeKit app.",
|
|
1052
1072
|
"required": false
|
|
1053
1073
|
},
|
|
1054
1074
|
"temperatureSensorSupply": {
|
|
1055
1075
|
"title": "Temperature Sensor Supply",
|
|
1056
1076
|
"type": "boolean",
|
|
1077
|
+
"default": false,
|
|
1057
1078
|
"description": "This enable extra supply temperature sensor to use with automations in HomeKit app.",
|
|
1058
1079
|
"required": false
|
|
1059
1080
|
},
|
|
1060
1081
|
"presets": {
|
|
1061
1082
|
"title": "Presets",
|
|
1062
1083
|
"type": "boolean",
|
|
1084
|
+
"default": false,
|
|
1063
1085
|
"description": "This enable extra buttons for configured presets and display it in HomeKit app.",
|
|
1064
1086
|
"required": false
|
|
1065
1087
|
},
|
|
@@ -1074,7 +1096,7 @@
|
|
|
1074
1096
|
"type": "string",
|
|
1075
1097
|
"placeholder": "Button name",
|
|
1076
1098
|
"description": "Your own name displayed in Homebridge/HomeKit app.",
|
|
1077
|
-
"required":
|
|
1099
|
+
"required": true
|
|
1078
1100
|
},
|
|
1079
1101
|
"mode": {
|
|
1080
1102
|
"title": "Mode",
|
|
@@ -1168,13 +1190,14 @@
|
|
|
1168
1190
|
]
|
|
1169
1191
|
}
|
|
1170
1192
|
],
|
|
1171
|
-
"required":
|
|
1193
|
+
"required": true
|
|
1172
1194
|
},
|
|
1173
1195
|
"displayType": {
|
|
1174
1196
|
"title": "Type",
|
|
1175
1197
|
"type": "integer",
|
|
1176
1198
|
"minimum": 0,
|
|
1177
1199
|
"maximum": 5,
|
|
1200
|
+
"default": 0,
|
|
1178
1201
|
"oneOf": [
|
|
1179
1202
|
{
|
|
1180
1203
|
"title": "None/Disabled",
|
|
@@ -1214,21 +1237,20 @@
|
|
|
1214
1237
|
}
|
|
1215
1238
|
],
|
|
1216
1239
|
"description": "Select the characteristic type to be displayed in HomeKit app.",
|
|
1217
|
-
"required":
|
|
1240
|
+
"required": true
|
|
1218
1241
|
},
|
|
1219
1242
|
"namePrefix": {
|
|
1220
1243
|
"title": "Prefix",
|
|
1221
1244
|
"type": "boolean",
|
|
1245
|
+
"default": false,
|
|
1222
1246
|
"description": "Enable/disable the accessory name as a prefix for button/sensor name.",
|
|
1223
1247
|
"required": false
|
|
1224
1248
|
}
|
|
1225
1249
|
}
|
|
1226
|
-
}
|
|
1227
|
-
"required": false
|
|
1250
|
+
}
|
|
1228
1251
|
}
|
|
1229
1252
|
}
|
|
1230
|
-
}
|
|
1231
|
-
"required": false
|
|
1253
|
+
}
|
|
1232
1254
|
},
|
|
1233
1255
|
"refreshInterval": {
|
|
1234
1256
|
"title": "Account Refresh Interval",
|
|
@@ -161,67 +161,77 @@
|
|
|
161
161
|
const accountKeys = Object.keys(pluginConfig[0].accounts[this.deviceIndex]);
|
|
162
162
|
|
|
163
163
|
//devices ata
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
164
|
+
if (deviceType === 0) {
|
|
165
|
+
const deviceAta = {
|
|
166
|
+
name: deviceName,
|
|
167
|
+
id: deviceId,
|
|
168
|
+
type: deviceType,
|
|
169
|
+
displayMode: 0,
|
|
170
|
+
heatDryFanMode: 0,
|
|
171
|
+
coolDryFanMode: 0,
|
|
172
|
+
autoDryFanMode: 0,
|
|
173
|
+
presets: false,
|
|
174
|
+
temperatureSensor: false,
|
|
175
|
+
temperatureSensorOutdoor: false,
|
|
176
|
+
buttonsSensors: []
|
|
177
|
+
};
|
|
178
|
+
|
|
179
|
+
const ataDevicesExist = pluginConfig[0].accounts[this.deviceIndex].ataDevices ?? false;
|
|
180
|
+
const ataDevices = ataDevicesExist ? pluginConfig[0].accounts[this.deviceIndex].ataDevices : pluginConfig[0].accounts[this.deviceIndex].ataDevices = [];
|
|
181
|
+
const ataDeviceIdExist = ataDevices.some(device => device.id === deviceId);
|
|
182
|
+
const pushTypeAta = ataDeviceIdExist ? false : ataDevices.push(deviceAta);
|
|
183
|
+
const pushNewDevice = ataDeviceIdExist ? false : newDevices.push(deviceId);
|
|
176
184
|
};
|
|
177
|
-
const ataDevices = accountKeys.includes('ataDevices') ? pluginConfig[0].accounts[this.deviceIndex].ataDevices : pluginConfig[0].accounts[this.deviceIndex].ataDevices = [];
|
|
178
|
-
const ataDeviceIdExist = ataDevices.some(device => device.id === deviceId)
|
|
179
|
-
const pushTypeAta = deviceType === 0 && !ataDeviceIdExist ? ataDevices.push(deviceAta) : false;
|
|
180
185
|
|
|
181
186
|
//devices atw
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
187
|
+
if (deviceType === 1) {
|
|
188
|
+
const deviceAtw = {
|
|
189
|
+
name: deviceName,
|
|
190
|
+
id: deviceId,
|
|
191
|
+
type: deviceType,
|
|
192
|
+
displayMode: 0,
|
|
193
|
+
temperatureSensor: false,
|
|
194
|
+
temperatureSensorFlow: false,
|
|
195
|
+
temperatureSensorReturn: false,
|
|
196
|
+
temperatureSensorFlowZone1: false,
|
|
197
|
+
temperatureSensorReturnZone1: false,
|
|
198
|
+
temperatureSensorFlowWaterTank: false,
|
|
199
|
+
temperatureSensorReturnWaterTank: false,
|
|
200
|
+
temperatureSensorFlowZone2: false,
|
|
201
|
+
temperatureSensorReturnZone2: false,
|
|
202
|
+
presets: false,
|
|
203
|
+
temperatureSensor: false,
|
|
204
|
+
temperatureSensorOutdoor: false,
|
|
205
|
+
buttonsSensors: []
|
|
206
|
+
};
|
|
207
|
+
const atwDevicesExist = pluginConfig[0].accounts[this.deviceIndex].atwDevices ?? false;
|
|
208
|
+
const atwDevices = atwDevicesExist ? pluginConfig[0].accounts[this.deviceIndex].atwDevices : pluginConfig[0].accounts[this.deviceIndex].atwDevices = [];
|
|
209
|
+
const atwDeviceIdExist = atwDevices.some(device => device.id === deviceId);
|
|
210
|
+
const pushTypeatw = atwDeviceIdExist ? false : atwDevices.push(deviceAtw);
|
|
211
|
+
const pushNewDevice = atwDeviceIdExist ? false : newDevices.push(deviceId);
|
|
200
212
|
};
|
|
201
|
-
const atwDevices = accountKeys.includes('atwDevices') ? pluginConfig[0].accounts[this.deviceIndex].atwDevices : pluginConfig[0].accounts[this.deviceIndex].atwDevices = [];
|
|
202
|
-
const atwDeviceIdExist = atwDevices.some(device => device.id === deviceId)
|
|
203
|
-
const pushTypeAtw = deviceType === 1 && !atwDeviceIdExist ? atwDevices.push(deviceAtw) : false;
|
|
204
213
|
|
|
205
214
|
//devices erv
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
215
|
+
if (deviceType === 3) {
|
|
216
|
+
const deviceErv = {
|
|
217
|
+
name: deviceName,
|
|
218
|
+
id: deviceId,
|
|
219
|
+
type: deviceType,
|
|
220
|
+
displayMode: 0,
|
|
221
|
+
temperatureSensor: false,
|
|
222
|
+
temperatureSensorOutdoor: false,
|
|
223
|
+
temperatureSensorSupply: false,
|
|
224
|
+
presets: false,
|
|
225
|
+
temperatureSensor: false,
|
|
226
|
+
temperatureSensorOutdoor: false,
|
|
227
|
+
buttonsSensors: []
|
|
228
|
+
};
|
|
229
|
+
const ervDevicesExist = pluginConfig[0].accounts[this.deviceIndex].ervDevices ?? false;
|
|
230
|
+
const ervDevices = ervDevicesExist ? pluginConfig[0].accounts[this.deviceIndex].ervDevices : pluginConfig[0].accounts[this.deviceIndex].ervDevices = [];
|
|
231
|
+
const ervDeviceIdExist = ervDevices.some(device => device.id === deviceId);
|
|
232
|
+
const pushTypeerv = ervDeviceIdExist ? false : ervDevices.push(deviceErv);
|
|
233
|
+
const pushNewDevice = ervDeviceIdExist ? false : newDevices.push(deviceId);
|
|
218
234
|
};
|
|
219
|
-
const ervDevices = accountKeys.includes('ervDevices') ? pluginConfig[0].accounts[this.deviceIndex].ervDevices : pluginConfig[0].accounts[this.deviceIndex].ervDevices = [];
|
|
220
|
-
const ervDeviceIdExist = ervDevices.some(device => device.id === deviceId)
|
|
221
|
-
const pushTypeErv = deviceType === 3 && !ervDeviceIdExist ? ervDevices.push(deviceErv) : false;
|
|
222
|
-
|
|
223
|
-
//push new devices to array
|
|
224
|
-
const pushNewDevice = ataDeviceIdExist || atwDeviceIdExist || ervDeviceIdExist ? false : newDevices.push(deviceId);
|
|
225
235
|
});
|
|
226
236
|
|
|
227
237
|
const devicesCount = newDevices.length;
|
package/index.js
CHANGED
|
@@ -38,11 +38,6 @@ class MelCloudPlatform {
|
|
|
38
38
|
}
|
|
39
39
|
accountsName.push(accountName);
|
|
40
40
|
|
|
41
|
-
//hide devices
|
|
42
|
-
const ataHideDeviceById = account.ataHideDeviceById || [];
|
|
43
|
-
const atwHideDeviceById = account.atwHideDeviceById || [];
|
|
44
|
-
const ervHideDeviceById = account.ervHideDeviceById || [];
|
|
45
|
-
|
|
46
41
|
//debug config
|
|
47
42
|
const enableDebugMode = account.enableDebugMode || false;
|
|
48
43
|
const debug = enableDebugMode ? log.info(`Account: ${accountName}, did finish launching.`) : false;
|
|
@@ -62,7 +57,7 @@ class MelCloudPlatform {
|
|
|
62
57
|
const prefDir = path.join(api.user.storagePath(), 'melcloud');
|
|
63
58
|
const accountInfoFile = `${prefDir}/${accountName}_Account`;
|
|
64
59
|
const buildingsFile = `${prefDir}/${accountName}_Buildings`;
|
|
65
|
-
const
|
|
60
|
+
const deviceFile = `${prefDir}/${accountName}_Device_`;
|
|
66
61
|
|
|
67
62
|
//create directory if it doesn't exist
|
|
68
63
|
try {
|
|
@@ -78,116 +73,110 @@ class MelCloudPlatform {
|
|
|
78
73
|
const deviceRefreshInterval = account.deviceRefreshInterval * 1000 || 5000;
|
|
79
74
|
|
|
80
75
|
//melcloud account
|
|
81
|
-
const melCloud = new MelCloud(user, passwd, language, accountInfoFile, buildingsFile,
|
|
82
|
-
melCloud.on('checkDevicesListComplete', (accountInfo, contextKey
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
const
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
//publish device
|
|
101
|
-
api.publishExternalAccessories(CONSTANTS.PluginName, [accessory]);
|
|
102
|
-
log.success(`${accountName}, ${deviceTypeText} ${deviceName}, published as external accessory.`);
|
|
76
|
+
const melCloud = new MelCloud(user, passwd, language, accountInfoFile, buildingsFile, deviceFile, enableDebugMode, refreshInterval, false);
|
|
77
|
+
melCloud.on('checkDevicesListComplete', (accountInfo, contextKey) => {
|
|
78
|
+
|
|
79
|
+
//Air Conditioner
|
|
80
|
+
for (const device of account.ataDevices) {
|
|
81
|
+
const deviceId = device.id.toString();
|
|
82
|
+
const deviceType = device.type;
|
|
83
|
+
const deviceName = device.name;
|
|
84
|
+
const deviceTypeText = CONSTANTS.DeviceType[deviceType];
|
|
85
|
+
const deviceInfoFile = `${prefDir}/${accountName}_Device_${deviceId}`;
|
|
86
|
+
const airConditioner = new DeviceAta(api, account, device, melCloud, accountInfo, contextKey, accountName, deviceId, deviceName, deviceTypeText, accountInfoFile, deviceInfoFile, deviceRefreshInterval)
|
|
87
|
+
airConditioner.on('publishAccessory', (accessory) => {
|
|
88
|
+
|
|
89
|
+
//publish device
|
|
90
|
+
api.publishExternalAccessories(CONSTANTS.PluginName, [accessory]);
|
|
91
|
+
log.success(`${accountName}, ${deviceTypeText} ${deviceName}, published as external accessory.`);
|
|
92
|
+
})
|
|
93
|
+
.on('devInfo', (devInfo) => {
|
|
94
|
+
log.info(devInfo);
|
|
103
95
|
})
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
})
|
|
107
|
-
.on('success', (message) => {
|
|
108
|
-
log.success(`${deviceTypeText}, ${deviceName}, ${message}`);
|
|
109
|
-
})
|
|
110
|
-
.on('message', (message) => {
|
|
111
|
-
log.info(`${deviceTypeText}, ${deviceName}, ${message}`);
|
|
112
|
-
})
|
|
113
|
-
.on('debug', (debug) => {
|
|
114
|
-
log.info(`${deviceTypeText}, ${deviceName}, debug: ${debug}`);
|
|
115
|
-
})
|
|
116
|
-
.on('warn', (warn) => {
|
|
117
|
-
log.warn(`${deviceTypeText}, ${deviceName}, ${warn}`);
|
|
118
|
-
})
|
|
119
|
-
.on('error', (error) => {
|
|
120
|
-
log.error(`${deviceTypeText}, ${deviceName}, ${error}`);
|
|
121
|
-
});
|
|
122
|
-
break;
|
|
123
|
-
case 1: //Heat Pump
|
|
124
|
-
const atwHideDevice = atwHideDeviceById.some(device => device.id === deviceId) ?? false;
|
|
125
|
-
if (atwHideDevice) {
|
|
126
|
-
return;
|
|
127
|
-
};
|
|
128
|
-
|
|
129
|
-
const heatPump = new DeviceAtw(api, account, melCloud, accountInfo, accountName, contextKey, deviceId, deviceName, deviceTypeText, accountInfoFile, deviceInfoFile, deviceRefreshInterval)
|
|
130
|
-
heatPump.on('publishAccessory', (accessory) => {
|
|
131
|
-
|
|
132
|
-
//publish device
|
|
133
|
-
api.publishExternalAccessories(CONSTANTS.PluginName, [accessory]);
|
|
134
|
-
log.success(`${accountName}, ${deviceTypeText} ${deviceName}, published as external accessory.`);
|
|
96
|
+
.on('success', (message) => {
|
|
97
|
+
log.success(`${deviceTypeText}, ${deviceName}, ${message}`);
|
|
135
98
|
})
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
})
|
|
139
|
-
.on('success', (message) => {
|
|
140
|
-
log.success(`${deviceTypeText}, ${deviceName}, ${message}`);
|
|
141
|
-
})
|
|
142
|
-
.on('message', (message) => {
|
|
143
|
-
log.info(`${deviceTypeText}, ${deviceName}, ${message}`);
|
|
144
|
-
})
|
|
145
|
-
.on('debug', (debug) => {
|
|
146
|
-
log.info(`${deviceTypeText}, ${deviceName}, debug: ${debug}`);
|
|
147
|
-
})
|
|
148
|
-
.on('warn', (warn) => {
|
|
149
|
-
log.warn(`${deviceTypeText}, ${deviceName}, ${warn}`);
|
|
150
|
-
})
|
|
151
|
-
.on('error', (error) => {
|
|
152
|
-
log.error(`${deviceTypeText}, ${deviceName}, ${error}`);
|
|
153
|
-
});
|
|
154
|
-
break;
|
|
155
|
-
case 3: //Energy Recovery Ventilation
|
|
156
|
-
const ervHideDevice = ervHideDeviceById.some(device => device.id === deviceId) ?? false;
|
|
157
|
-
if (ervHideDevice) {
|
|
158
|
-
return;
|
|
159
|
-
};
|
|
160
|
-
|
|
161
|
-
const energyRecoveryVentilation = new DeviceErv(api, account, melCloud, accountInfo, accountName, contextKey, deviceId, deviceName, deviceTypeText, accountInfoFile, deviceInfoFile, deviceRefreshInterval)
|
|
162
|
-
energyRecoveryVentilation.on('publishAccessory', (accessory) => {
|
|
163
|
-
|
|
164
|
-
//publish device
|
|
165
|
-
api.publishExternalAccessories(CONSTANTS.PluginName, [accessory]);
|
|
166
|
-
log.success(`${accountName}, ${deviceTypeText} ${deviceName}, published as external accessory.`);
|
|
99
|
+
.on('message', (message) => {
|
|
100
|
+
log.info(`${deviceTypeText}, ${deviceName}, ${message}`);
|
|
167
101
|
})
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
102
|
+
.on('debug', (debug) => {
|
|
103
|
+
log.info(`${deviceTypeText}, ${deviceName}, debug: ${debug}`);
|
|
104
|
+
})
|
|
105
|
+
.on('warn', (warn) => {
|
|
106
|
+
log.warn(`${deviceTypeText}, ${deviceName}, ${warn}`);
|
|
107
|
+
})
|
|
108
|
+
.on('error', (error) => {
|
|
109
|
+
log.error(`${deviceTypeText}, ${deviceName}, ${error}`);
|
|
110
|
+
});
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
//Heat Pump
|
|
114
|
+
for (const device of account.atwDevices) {
|
|
115
|
+
const deviceId = device.id.toString();
|
|
116
|
+
const deviceType = device.type;
|
|
117
|
+
const deviceName = device.name;
|
|
118
|
+
const deviceTypeText = CONSTANTS.DeviceType[deviceType];
|
|
119
|
+
const deviceInfoFile = `${prefDir}/${accountName}_Device_${deviceId}`;
|
|
120
|
+
const heatPump = new DeviceAtw(api, account, melCloud, device, accountInfo, contextKey, accountName, deviceId, deviceName, deviceTypeText, accountInfoFile, deviceInfoFile, deviceRefreshInterval)
|
|
121
|
+
heatPump.on('publishAccessory', (accessory) => {
|
|
122
|
+
|
|
123
|
+
//publish device
|
|
124
|
+
api.publishExternalAccessories(CONSTANTS.PluginName, [accessory]);
|
|
125
|
+
log.success(`${accountName}, ${deviceTypeText} ${deviceName}, published as external accessory.`);
|
|
126
|
+
})
|
|
127
|
+
.on('devInfo', (devInfo) => {
|
|
128
|
+
log.info(devInfo);
|
|
129
|
+
})
|
|
130
|
+
.on('success', (message) => {
|
|
131
|
+
log.success(`${deviceTypeText}, ${deviceName}, ${message}`);
|
|
132
|
+
})
|
|
133
|
+
.on('message', (message) => {
|
|
134
|
+
log.info(`${deviceTypeText}, ${deviceName}, ${message}`);
|
|
135
|
+
})
|
|
136
|
+
.on('debug', (debug) => {
|
|
137
|
+
log.info(`${deviceTypeText}, ${deviceName}, debug: ${debug}`);
|
|
138
|
+
})
|
|
139
|
+
.on('warn', (warn) => {
|
|
140
|
+
log.warn(`${deviceTypeText}, ${deviceName}, ${warn}`);
|
|
141
|
+
})
|
|
142
|
+
.on('error', (error) => {
|
|
143
|
+
log.error(`${deviceTypeText}, ${deviceName}, ${error}`);
|
|
144
|
+
});
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
//Energy Recovery Ventilation
|
|
148
|
+
for (const device of account.ervDevices) {
|
|
149
|
+
const deviceId = device.id.toString();
|
|
150
|
+
const deviceType = device.type;
|
|
151
|
+
const deviceName = device.name;
|
|
152
|
+
const deviceTypeText = CONSTANTS.DeviceType[deviceType];
|
|
153
|
+
const deviceInfoFile = `${prefDir}/${accountName}_Device_${deviceId}`;
|
|
154
|
+
const energyRecoveryVentilation = new DeviceErv(api, account, device, melCloud, accountInfo, contextKey, accountName, deviceId, deviceName, deviceTypeText, accountInfoFile, deviceInfoFile, deviceRefreshInterval)
|
|
155
|
+
energyRecoveryVentilation.on('publishAccessory', (accessory) => {
|
|
156
|
+
|
|
157
|
+
//publish device
|
|
158
|
+
api.publishExternalAccessories(CONSTANTS.PluginName, [accessory]);
|
|
159
|
+
log.success(`${accountName}, ${deviceTypeText} ${deviceName}, published as external accessory.`);
|
|
160
|
+
})
|
|
161
|
+
.on('devInfo', (devInfo) => {
|
|
162
|
+
log.info(devInfo);
|
|
163
|
+
})
|
|
164
|
+
.on('success', (message) => {
|
|
165
|
+
log.success(`${deviceTypeText}, ${deviceName}, ${message}`);
|
|
166
|
+
})
|
|
167
|
+
.on('message', (message) => {
|
|
168
|
+
log.info(`${deviceTypeText}, ${deviceName}, ${message}`);
|
|
169
|
+
})
|
|
170
|
+
.on('debug', (debug) => {
|
|
171
|
+
log.info(`${deviceTypeText}, ${deviceName}, debug: ${debug}`);
|
|
172
|
+
})
|
|
173
|
+
.on('warn', (warn) => {
|
|
174
|
+
log.warn(`${deviceTypeText}, ${deviceName}, ${warn}`);
|
|
175
|
+
})
|
|
176
|
+
.on('error', (error) => {
|
|
177
|
+
log.error(`${deviceTypeText}, ${deviceName}, ${error}`);
|
|
178
|
+
});
|
|
179
|
+
};
|
|
191
180
|
})
|
|
192
181
|
.on('success', (message) => {
|
|
193
182
|
log.success(`Account ${accountName}, ${message}`);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"displayName": "MELCloud Control",
|
|
3
3
|
"name": "homebridge-melcloud-control",
|
|
4
|
-
"version": "2.5.0-beta.
|
|
4
|
+
"version": "2.5.0-beta.76",
|
|
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
|
@@ -7,7 +7,7 @@ const CONSTANTS = require('./constants.json');
|
|
|
7
7
|
let Accessory, Characteristic, Service, Categories, AccessoryUUID;
|
|
8
8
|
|
|
9
9
|
class DeviceAta extends EventEmitter {
|
|
10
|
-
constructor(api, account, melCloud, accountInfo,
|
|
10
|
+
constructor(api, account, device, melCloud, accountInfo, contextKey, accountName, deviceId, deviceName, deviceTypeText, accountInfoFile, deviceInfoFile, refreshInterval) {
|
|
11
11
|
super();
|
|
12
12
|
|
|
13
13
|
Accessory = api.platformAccessory;
|
|
@@ -17,14 +17,14 @@ class DeviceAta extends EventEmitter {
|
|
|
17
17
|
AccessoryUUID = api.hap.uuid;
|
|
18
18
|
|
|
19
19
|
//account config
|
|
20
|
-
this.displayMode =
|
|
21
|
-
this.temperatureSensor =
|
|
22
|
-
this.temperatureSensorOutdoor =
|
|
23
|
-
this.presetsEnabled =
|
|
24
|
-
this.heatDryFanMode =
|
|
25
|
-
this.coolDryFanMode =
|
|
26
|
-
this.autoDryFanMode =
|
|
27
|
-
this.buttons =
|
|
20
|
+
this.displayMode = device.displayMode || 0;
|
|
21
|
+
this.temperatureSensor = device.temperatureSensor || false;
|
|
22
|
+
this.temperatureSensorOutdoor = device.temperatureSensorOutdoor || false;
|
|
23
|
+
this.presetsEnabled = device.presets || false;
|
|
24
|
+
this.heatDryFanMode = device.heatDryFanMode || 1; //NONE, HEAT, DRY, FAN
|
|
25
|
+
this.coolDryFanMode = device.coolDryFanMode || 1; //NONE, COOL, DRY, FAN
|
|
26
|
+
this.autoDryFanMode = device.autoDryFanMode || 1; //NONE, AUTO, DRY, FAN
|
|
27
|
+
this.buttons = device.buttons || [];
|
|
28
28
|
this.disableLogInfo = account.disableLogInfo || false;
|
|
29
29
|
this.disableLogDeviceInfo = account.disableLogDeviceInfo || false;
|
|
30
30
|
this.enableDebugMode = account.enableDebugMode || false;
|
|
@@ -69,7 +69,7 @@ class DeviceAta extends EventEmitter {
|
|
|
69
69
|
accountInfoFile: accountInfoFile,
|
|
70
70
|
deviceInfoFile: deviceInfoFile,
|
|
71
71
|
debugLog: account.enableDebugMode,
|
|
72
|
-
refreshInterval:
|
|
72
|
+
refreshInterval: refreshInterval
|
|
73
73
|
});
|
|
74
74
|
|
|
75
75
|
this.melCloudAta.on('externalIntegrations', (deviceData, deviceState) => {
|
package/src/deviceatw.js
CHANGED
|
@@ -7,7 +7,7 @@ const CONSTANTS = require('./constants.json');
|
|
|
7
7
|
let Accessory, Characteristic, Service, Categories, AccessoryUUID;
|
|
8
8
|
|
|
9
9
|
class DeviceAtw extends EventEmitter {
|
|
10
|
-
constructor(api, account, melCloud, accountInfo,
|
|
10
|
+
constructor(api, account, device, melCloud, accountInfo, contextKey, accountName, deviceId, deviceName, deviceTypeText, accountInfoFile, deviceInfoFile, refreshInterval) {
|
|
11
11
|
super();
|
|
12
12
|
|
|
13
13
|
Accessory = api.platformAccessory;
|
|
@@ -17,18 +17,18 @@ class DeviceAtw extends EventEmitter {
|
|
|
17
17
|
AccessoryUUID = api.hap.uuid;
|
|
18
18
|
|
|
19
19
|
//account config
|
|
20
|
-
this.displayMode =
|
|
21
|
-
this.temperatureSensor =
|
|
22
|
-
this.temperatureSensorFlow =
|
|
23
|
-
this.temperatureSensorReturn =
|
|
24
|
-
this.temperatureSensorFlowZone1 =
|
|
25
|
-
this.temperatureSensorReturnZone1 =
|
|
26
|
-
this.temperatureSensorFlowWaterTank =
|
|
27
|
-
this.temperatureSensorReturnWaterTank =
|
|
28
|
-
this.temperatureSensorFlowZone2 =
|
|
29
|
-
this.temperatureSensorReturnZone2 =
|
|
30
|
-
this.presetsEnabled =
|
|
31
|
-
this.buttons =
|
|
20
|
+
this.displayMode = device.displayMode || 0;
|
|
21
|
+
this.temperatureSensor = device.temperatureSensor || false;
|
|
22
|
+
this.temperatureSensorFlow = device.temperatureSensorFlow || false;
|
|
23
|
+
this.temperatureSensorReturn = device.temperatureSensorReturn || false;
|
|
24
|
+
this.temperatureSensorFlowZone1 = device.temperatureSensorFlowZone1 || false;
|
|
25
|
+
this.temperatureSensorReturnZone1 = device.temperatureSensorFlowWaterTank || false;
|
|
26
|
+
this.temperatureSensorFlowWaterTank = device.temperatureSensorFlowZone1 || false;
|
|
27
|
+
this.temperatureSensorReturnWaterTank = device.temperatureSensorReturnWaterTank || false;
|
|
28
|
+
this.temperatureSensorFlowZone2 = device.temperatureSensorFlowZone2 || false;
|
|
29
|
+
this.temperatureSensorReturnZone2 = device.temperatureSensorReturnZone2 || false;
|
|
30
|
+
this.presetsEnabled = device.presets || false;
|
|
31
|
+
this.buttons = device.buttons || [];
|
|
32
32
|
this.disableLogInfo = account.disableLogInfo || false;
|
|
33
33
|
this.disableLogDeviceInfo = account.disableLogDeviceInfo || false;
|
|
34
34
|
this.enableDebugMode = account.enableDebugMode || false;
|
|
@@ -73,7 +73,7 @@ class DeviceAtw extends EventEmitter {
|
|
|
73
73
|
accountInfoFile: accountInfoFile,
|
|
74
74
|
deviceInfoFile: deviceInfoFile,
|
|
75
75
|
debugLog: account.enableDebugMode,
|
|
76
|
-
refreshInterval:
|
|
76
|
+
refreshInterval: refreshInterval
|
|
77
77
|
});
|
|
78
78
|
|
|
79
79
|
this.melCloudAtw.on('externalIntegrations', (deviceData, deviceState) => {
|
package/src/deviceerv.js
CHANGED
|
@@ -7,7 +7,7 @@ const CONSTANTS = require('./constants.json');
|
|
|
7
7
|
let Accessory, Characteristic, Service, Categories, AccessoryUUID;
|
|
8
8
|
|
|
9
9
|
class DeviceErv extends EventEmitter {
|
|
10
|
-
constructor(api, account, melCloud, accountInfo,
|
|
10
|
+
constructor(api, account, device, melCloud, accountInfo, contextKey, accountName, deviceId, deviceName, deviceTypeText, accountInfoFile, deviceInfoFile, refreshInterval) {
|
|
11
11
|
super();
|
|
12
12
|
|
|
13
13
|
Accessory = api.platformAccessory;
|
|
@@ -17,12 +17,12 @@ class DeviceErv extends EventEmitter {
|
|
|
17
17
|
AccessoryUUID = api.hap.uuid;
|
|
18
18
|
|
|
19
19
|
//account config
|
|
20
|
-
this.displayMode =
|
|
21
|
-
this.temperatureSensor =
|
|
22
|
-
this.temperatureSensorOutdoor =
|
|
23
|
-
this.temperatureSensorSupply =
|
|
24
|
-
this.presetsEnabled =
|
|
25
|
-
this.buttons =
|
|
20
|
+
this.displayMode = device.displayMode || 0;
|
|
21
|
+
this.temperatureSensor = device.temperatureSensor || false;
|
|
22
|
+
this.temperatureSensorOutdoor = device.temperatureSensorOutdoor || false;
|
|
23
|
+
this.temperatureSensorSupply = device.temperatureSensorSupply || false;
|
|
24
|
+
this.presetsEnabled = device.presets || false;
|
|
25
|
+
this.buttons = device.buttons || [];
|
|
26
26
|
this.disableLogInfo = account.disableLogInfo || false;
|
|
27
27
|
this.disableLogDeviceInfo = account.disableLogDeviceInfo || false;
|
|
28
28
|
this.enableDebugMode = account.enableDebugMode || false;
|
|
@@ -67,7 +67,7 @@ class DeviceErv extends EventEmitter {
|
|
|
67
67
|
accountInfoFile: accountInfoFile,
|
|
68
68
|
deviceInfoFile: deviceInfoFile,
|
|
69
69
|
debugLog: account.enableDebugMode,
|
|
70
|
-
refreshInterval:
|
|
70
|
+
refreshInterval: refreshInterval
|
|
71
71
|
});
|
|
72
72
|
|
|
73
73
|
this.melCloudErv.on('externalIntegrations', (deviceData, deviceState) => {
|
package/src/melcloud.js
CHANGED
|
@@ -16,6 +16,7 @@ class MelCloud extends EventEmitter {
|
|
|
16
16
|
this.enableDebugMode = enableDebugMode;
|
|
17
17
|
this.refreshInterval = refreshInterval;
|
|
18
18
|
this.connectForConfig = connectForConfig;
|
|
19
|
+
this.emitReady = true;
|
|
19
20
|
this.contextKey = '';
|
|
20
21
|
this.devicesId = [];
|
|
21
22
|
|
|
@@ -179,14 +180,11 @@ class MelCloud extends EventEmitter {
|
|
|
179
180
|
const deviceInfoFile = `${this.deviceInfoFile}${deviceId}`;
|
|
180
181
|
await this.saveData(deviceInfoFile, deviceInfo);
|
|
181
182
|
const debug = this.enableDebugMode ? this.emit('debug', `Device: ${deviceName} info saved.`) : false;
|
|
182
|
-
|
|
183
|
-
//prepare device if not in devices array
|
|
184
|
-
if (!this.devicesId.includes(deviceId)) {
|
|
185
|
-
this.devicesId.push(deviceId);
|
|
186
|
-
this.emit('checkDevicesListComplete', this.accountInfo, contextKey, deviceInfo);
|
|
187
|
-
}
|
|
188
183
|
};
|
|
189
184
|
|
|
185
|
+
//emit check devices list complete
|
|
186
|
+
const emit = this.emitReady ? this.emit('checkDevicesListComplete', this.accountInfo, contextKey) : false;
|
|
187
|
+
|
|
190
188
|
return true;
|
|
191
189
|
} catch (error) {
|
|
192
190
|
const stop = connectForConfig ? false : this.impulseGenerator.stop();
|