iobroker.lorawan 1.18.57 → 1.18.58
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 +3 -0
- package/io-package.json +14 -14
- package/main.js +60 -54
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -23,6 +23,9 @@ For now there is documentation in English here: https://wiki.hafenmeister.de
|
|
|
23
23
|
Placeholder for the next version (at the beginning of the line):
|
|
24
24
|
### **WORK IN PROGRESS**
|
|
25
25
|
-->
|
|
26
|
+
### 1.18.58 (2025-12-31)
|
|
27
|
+
* (BenAhrdt) serialize and cache the config messagens
|
|
28
|
+
|
|
26
29
|
### 1.18.57 (2025-12-31)
|
|
27
30
|
* (BenAhrdt) cache Infos in config for more performance
|
|
28
31
|
|
package/io-package.json
CHANGED
|
@@ -1,8 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"common": {
|
|
3
3
|
"name": "lorawan",
|
|
4
|
-
"version": "1.18.
|
|
4
|
+
"version": "1.18.58",
|
|
5
5
|
"news": {
|
|
6
|
+
"1.18.58": {
|
|
7
|
+
"en": "serialize and cache the config messagens",
|
|
8
|
+
"de": "serialisieren und kache die config messagens",
|
|
9
|
+
"ru": "сериализировать и кэшировать config messagens",
|
|
10
|
+
"pt": "serialize e cache as mensagens de configuração",
|
|
11
|
+
"nl": "serialiseren en cache de config messages",
|
|
12
|
+
"fr": "sérialisez et cachez les messages de configuration",
|
|
13
|
+
"it": "serializzare e memorizzare i messaggi di configurazione",
|
|
14
|
+
"es": "serialize y cache los mensajes de config",
|
|
15
|
+
"pl": "serializuj i buforuj wiadomości konfiguracyjne",
|
|
16
|
+
"uk": "послідовність і кешування конфігураційних повідомлень",
|
|
17
|
+
"zh-cn": "序列化和缓存配置信件"
|
|
18
|
+
},
|
|
6
19
|
"1.18.57": {
|
|
7
20
|
"en": "cache Infos in config for more performance",
|
|
8
21
|
"de": "cache Infos in config für mehr Leistung",
|
|
@@ -80,19 +93,6 @@
|
|
|
80
93
|
"pl": "dodać możliwość ustawienia Devicesuffix w państwach LoraWAN",
|
|
81
94
|
"uk": "додати можливість встановити Devicesuffix в LoraWAN",
|
|
82
95
|
"zh-cn": "添加在 LoraWAN 州设置设备后缀的可能性"
|
|
83
|
-
},
|
|
84
|
-
"1.18.51": {
|
|
85
|
-
"en": "add \"Temperatur\" to autmatic assign",
|
|
86
|
-
"de": "\"Temperatur\" zu autmatic assign hinzufügen",
|
|
87
|
-
"ru": "добавить \"Temperatur\" в аутматическое назначение",
|
|
88
|
-
"pt": "adicionar \"Temperatur\" à atribuição autmática",
|
|
89
|
-
"nl": "\"Temperatur\" toevoegen aan autmatisch toewijzen",
|
|
90
|
-
"fr": "ajouter \"Temperatur\" à l'attribut autmatique",
|
|
91
|
-
"it": "aggiungere \"Temperatur\" all'assegnazione autmatica",
|
|
92
|
-
"es": "añadir \"Temperatur\" a la asignación autmática",
|
|
93
|
-
"pl": "dodaj \"Temperatur\" do przypisania automatycznego",
|
|
94
|
-
"uk": "додати \"Temperatur\" до тематичного знака",
|
|
95
|
-
"zh-cn": "在自定义中添加“临时”"
|
|
96
96
|
}
|
|
97
97
|
},
|
|
98
98
|
"titleLang": {
|
package/main.js
CHANGED
|
@@ -1361,78 +1361,84 @@ class Lorawan extends utils.Adapter {
|
|
|
1361
1361
|
obj.command === 'getApplicationsForClimateModeConfig'
|
|
1362
1362
|
) {
|
|
1363
1363
|
try {
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
adapterObject.
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
currentApplications[value]
|
|
1383
|
-
|
|
1384
|
-
|
|
1364
|
+
await this.runSerializedMessages(async () => {
|
|
1365
|
+
let myCount = 0;
|
|
1366
|
+
const applications = [];
|
|
1367
|
+
if (obj.command === 'getApplicationsForConfig') {
|
|
1368
|
+
applications[myCount] = { label: '* (Wildcard)', value: '*' };
|
|
1369
|
+
myCount++;
|
|
1370
|
+
} else if (obj.command === 'getApplicationsForClimateModeConfig') {
|
|
1371
|
+
applications[myCount] = { label: '* Not Present (Virtual)', value: 'NotPresent' };
|
|
1372
|
+
myCount++;
|
|
1373
|
+
}
|
|
1374
|
+
const currentApplications = {};
|
|
1375
|
+
const adapterObjects = await this.getAdapterObjectsCached();
|
|
1376
|
+
for (const adapterObject of Object.values(adapterObjects)) {
|
|
1377
|
+
if (adapterObject.type === 'folder' && adapterObject._id.endsWith('uplink')) {
|
|
1378
|
+
adapterObject._id = this.removeNamespace(adapterObject._id);
|
|
1379
|
+
const changeInfo = await this.getChangeInfoCached(adapterObject._id);
|
|
1380
|
+
const label = changeInfo?.usedApplicationName;
|
|
1381
|
+
const value = changeInfo?.applicationId;
|
|
1382
|
+
if (!currentApplications[value]) {
|
|
1383
|
+
currentApplications[value] = value;
|
|
1384
|
+
applications[myCount] = { label: label, value: value };
|
|
1385
|
+
myCount++;
|
|
1386
|
+
}
|
|
1385
1387
|
}
|
|
1386
1388
|
}
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1389
|
+
applications.sort(this.sortByLabel);
|
|
1390
|
+
this.sendTo(obj.from, obj.command, applications, obj.callback);
|
|
1391
|
+
});
|
|
1390
1392
|
} catch (error) {
|
|
1391
1393
|
this.log.error(error);
|
|
1392
1394
|
}
|
|
1393
1395
|
} else if (obj.command === 'getDevicesForConfig' || obj.command === 'getDevicesForClimateConfig') {
|
|
1394
1396
|
try {
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
}
|
|
1401
|
-
const adapterObjects = await this.getAdapterObjectsCached();
|
|
1402
|
-
for (const adapterObject of Object.values(adapterObjects)) {
|
|
1403
|
-
if (
|
|
1404
|
-
adapterObject.type === 'folder' &&
|
|
1405
|
-
(adapterObject._id.includes(obj.message.application) ||
|
|
1406
|
-
obj.message.application === '*') &&
|
|
1407
|
-
adapterObject._id.endsWith('uplink')
|
|
1408
|
-
) {
|
|
1409
|
-
adapterObject._id = this.removeNamespace(adapterObject._id);
|
|
1410
|
-
const changeInfo = await this.getChangeInfoCached(adapterObject._id);
|
|
1411
|
-
const label = changeInfo?.usedDeviceId;
|
|
1412
|
-
const value = changeInfo?.deviceEUI;
|
|
1413
|
-
devices[myCount] = { label: label, value: value };
|
|
1397
|
+
await this.runSerializedMessages(async () => {
|
|
1398
|
+
let myCount = 0;
|
|
1399
|
+
const devices = [];
|
|
1400
|
+
if (obj.command === 'getDevicesForConfig') {
|
|
1401
|
+
devices[myCount] = { label: '* (Wildcard)', value: '*' };
|
|
1414
1402
|
myCount++;
|
|
1415
1403
|
}
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1404
|
+
const adapterObjects = await this.getAdapterObjectsCached();
|
|
1405
|
+
for (const adapterObject of Object.values(adapterObjects)) {
|
|
1406
|
+
if (
|
|
1407
|
+
adapterObject.type === 'folder' &&
|
|
1408
|
+
(adapterObject._id.includes(obj.message.application) ||
|
|
1409
|
+
obj.message.application === '*') &&
|
|
1410
|
+
adapterObject._id.endsWith('uplink')
|
|
1411
|
+
) {
|
|
1412
|
+
adapterObject._id = this.removeNamespace(adapterObject._id);
|
|
1413
|
+
const changeInfo = await this.getChangeInfoCached(adapterObject._id);
|
|
1414
|
+
const label = changeInfo?.usedDeviceId;
|
|
1415
|
+
const value = changeInfo?.deviceEUI;
|
|
1416
|
+
devices[myCount] = { label: label, value: value };
|
|
1417
|
+
myCount++;
|
|
1418
|
+
}
|
|
1419
|
+
}
|
|
1420
|
+
devices.sort(this.sortByLabel);
|
|
1421
|
+
this.sendTo(obj.from, obj.command, devices, obj.callback);
|
|
1422
|
+
});
|
|
1419
1423
|
} catch (error) {
|
|
1420
1424
|
this.log.error(error);
|
|
1421
1425
|
}
|
|
1422
1426
|
} else if (obj.command === 'getFoldersForConfig') {
|
|
1423
1427
|
try {
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1428
|
+
await this.runSerializedMessages(async () => {
|
|
1429
|
+
const devices = [
|
|
1430
|
+
{ label: '* (Wildcard)', value: '*' },
|
|
1431
|
+
{ label: 'uplink.decoded', value: 'uplink.decoded' },
|
|
1432
|
+
{ label: 'downlink.control', value: 'downlink.control' },
|
|
1433
|
+
];
|
|
1434
|
+
this.sendTo(obj.from, obj.command, devices, obj.callback);
|
|
1435
|
+
});
|
|
1430
1436
|
} catch (error) {
|
|
1431
1437
|
this.log.error(error);
|
|
1432
1438
|
}
|
|
1433
1439
|
} else if (obj.command === 'getStatesForConfig' || obj.command === 'getStatesForClimateConfig') {
|
|
1434
1440
|
try {
|
|
1435
|
-
await this.
|
|
1441
|
+
await this.runSerializedMessages(async () => {
|
|
1436
1442
|
let myCount = 0;
|
|
1437
1443
|
const states = [];
|
|
1438
1444
|
const possibleTypes = { state: true };
|
|
@@ -1621,7 +1627,7 @@ class Lorawan extends utils.Adapter {
|
|
|
1621
1627
|
return false;
|
|
1622
1628
|
}
|
|
1623
1629
|
|
|
1624
|
-
async
|
|
1630
|
+
async runSerializedMessages(fn) {
|
|
1625
1631
|
const run = async () => fn();
|
|
1626
1632
|
|
|
1627
1633
|
// Queue verlängern
|