iobroker.lorawan 1.18.54 → 1.18.56

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 CHANGED
@@ -23,6 +23,13 @@ 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.56 (2025-12-30)
27
+ * (BenAhrdt) remoove namespace twice remooved
28
+ * (BenAhrdt) serialize getConfigStates
29
+
30
+ ### 1.18.55 (2025-12-29)
31
+ * (BenAhrdt) bugfix folderinclusion
32
+
26
33
  ### 1.18.54 (2025-12-29)
27
34
  * (BenAhrdt) add '.' to folders in config selection
28
35
 
package/io-package.json CHANGED
@@ -1,8 +1,34 @@
1
1
  {
2
2
  "common": {
3
3
  "name": "lorawan",
4
- "version": "1.18.54",
4
+ "version": "1.18.56",
5
5
  "news": {
6
+ "1.18.56": {
7
+ "en": "remoove namespace twice remooved\nserialize getConfigStates",
8
+ "de": "remoove namespace zweimal remooved\nserialisieren getConfigStates",
9
+ "ru": "remoove namespace дважды удаляется\nсерийный GetConfigStates",
10
+ "pt": "remoove namespace duas vezes remooved\nserialize getConfigStates",
11
+ "nl": "naamruimte twee keer verplaatsen\nserialiseren getConfigStates",
12
+ "fr": "remove namespace deux fois removed\nsérialiser getConfigStates",
13
+ "it": "rimoove namespace due volte rimuovi\nserializzare ottenereConfigStates",
14
+ "es": "remoove namespace dos remooved\nserialize getConfigStates",
15
+ "pl": "remoove namespace two remooved\nserialize getConfigurations",
16
+ "uk": "remoove namespace двічі remooved\nсертифіковано getConfigStates",
17
+ "zh-cn": "两次重新移动命名空间\n序列化获取配置状态"
18
+ },
19
+ "1.18.55": {
20
+ "en": "bugfix folderinclusion",
21
+ "de": "bugfix ordnerinclusion",
22
+ "ru": "bugfix включение папок",
23
+ "pt": "inclusão de pastas de correção de erros",
24
+ "nl": "bugfix-map-integratie",
25
+ "fr": "bugfix dossierinclusion",
26
+ "it": "bugfix folderinclusione",
27
+ "es": "carpeta bugfixinclusion",
28
+ "pl": "włączenie folderu bugfix",
29
+ "uk": "папка прикусу",
30
+ "zh-cn": "包含错误文件夹"
31
+ },
6
32
  "1.18.54": {
7
33
  "en": "add '.' to folders in config selection",
8
34
  "de": "fügen sie '.' in ordner in config auswahl",
@@ -67,32 +93,6 @@
67
93
  "pl": "filtr w trybie debugowania (narzędzie dev)",
68
94
  "uk": "фільтр в режимі Debug (розробний інструмент)",
69
95
  "zh-cn": "调试模式中的过滤器( dev 工具)"
70
- },
71
- "1.18.49": {
72
- "en": "Read and send always all light attributes",
73
- "de": "Lesen und senden Sie immer alle Licht-Attribute",
74
- "ru": "Читайте и отправляйте всегда все световые атрибуты",
75
- "pt": "Ler e enviar sempre todos os atributos de luz",
76
- "nl": "Lees en stuur altijd alle lichtattributen",
77
- "fr": "Lire et envoyer toujours tous les attributs de lumière",
78
- "it": "Leggi e invia sempre tutti gli attributi leggeri",
79
- "es": "Lea y envíe siempre todos los atributos de luz",
80
- "pl": "Czytaj i wysyłaj zawsze wszystkie atrybuty światła",
81
- "uk": "Читайте і надсилайте завжди всі атрибути світла",
82
- "zh-cn": "读取并发送所有光属性"
83
- },
84
- "1.18.48": {
85
- "en": "Set the selection to usedNames (application and device)",
86
- "de": "Setzen Sie die Auswahl auf gebrauchtNamen (Anwendung und Gerät)",
87
- "ru": "Установите выбор используемых имен (приложения и устройства)",
88
- "pt": "Define a seleção para nomes usados (aplicação e dispositivo)",
89
- "nl": "De selectie instellen op gebruikte Namen (toepassing en apparaat)",
90
- "fr": "Définissez la sélection aux noms utilisés (application et périphérique)",
91
- "it": "Impostare la selezione per i nomi utilizzati (applicazione e dispositivo)",
92
- "es": "Establecer la selección para utilizarNames (aplicación y dispositivo)",
93
- "pl": "Ustaw wybór na używane Nazwy (aplikacja i urządzenie)",
94
- "uk": "Налаштуйте вибір для використанняНазви (застосування та пристрій)",
95
- "zh-cn": "将选中区域设定为使用的名称( 应用程序和设备)"
96
96
  }
97
97
  },
98
98
  "titleLang": {
@@ -993,7 +993,9 @@ class bridgeClass {
993
993
  (changeInfo.applicationId === config.Application || config.Application === '*') &&
994
994
  (changeInfo.deviceEUI === config.Device || config.Device === '*') &&
995
995
  (id.includes(`.${config.Folder}.`) || config.Folder === '*') &&
996
- (id.includes(`.decoded.${config.State}`) || config.State === '*')
996
+ (config.State === '*' ||
997
+ (config.State.endsWith('.') && id.includes(`.decoded.${config.State}`)) ||
998
+ (!config.State.endsWith('.') && id.endsWith(`.decoded.${config.State}`)))
997
999
  ) {
998
1000
  Bridgestate.discover = !config.exclude;
999
1001
  Bridgestate.publish = true;
@@ -1065,7 +1067,9 @@ class bridgeClass {
1065
1067
  (changeInfo.applicationId === config.Application || config.Application === '*') &&
1066
1068
  (changeInfo.deviceEUI === config.Device || config.Device === '*') &&
1067
1069
  (id.includes(`.${config.Folder}.`) || config.Folder === '*') &&
1068
- (id.includes(`.control.${config.State}`) || config.State === '*')
1070
+ (config.State === '*' ||
1071
+ (config.State.endsWith('.') && id.includes(`.control.${config.State}`)) ||
1072
+ (!config.State.endsWith('.') && id.endsWith(`.control.${config.State}`)))
1069
1073
  ) {
1070
1074
  Bridgestate.discover = !config.exclude;
1071
1075
  Bridgestate.publish = config.publish;
package/main.js CHANGED
@@ -48,6 +48,10 @@ class Lorawan extends utils.Adapter {
48
48
  hash: 'f3988f71e0d6248fbf690c414bcb46b0500c3a8b3ec9adb9c66be2774ec12291',
49
49
  salt: 'LoRaWANBeScJoFr',
50
50
  };
51
+
52
+ // Serialize getStateConfig
53
+ this._configQueue = Promise.resolve();
54
+ this._changeInfoCache = new Map();
51
55
  }
52
56
 
53
57
  onFileChange(_id, _fileName, _size) {
@@ -1427,54 +1431,56 @@ class Lorawan extends utils.Adapter {
1427
1431
  }
1428
1432
  } else if (obj.command === 'getStatesForConfig' || obj.command === 'getStatesForClimateConfig') {
1429
1433
  try {
1430
- let myCount = 0;
1431
- const states = [];
1432
- const possibleTypes = { state: true };
1433
- if (obj.command === 'getStatesForConfig') {
1434
- states[myCount] = { label: '* (Wildcard)', value: '*' };
1435
- myCount++;
1436
- possibleTypes.folder = true;
1437
- }
1438
- const currentStates = {};
1439
- const adapterObjects = await this.getAdapterObjectsAsync();
1440
- for (const adapterObject of Object.values(adapterObjects)) {
1441
- if (
1442
- possibleTypes[adapterObject.type] === true &&
1443
- (adapterObject._id.includes(obj.message.application) ||
1444
- obj.message.application === '*') &&
1445
- (adapterObject._id.includes(obj.message.device) || obj.message.device === '*') &&
1446
- (adapterObject._id.includes(obj.message.folder) ||
1447
- (obj.message.folder === '*' &&
1448
- (adapterObject._id.includes('uplink.decoded') ||
1449
- adapterObject._id.includes('downlink.control'))))
1450
- ) {
1451
- adapterObject._id = this.removeNamespace(adapterObject._id);
1452
- const changeInfo = await this.getChangeInfo(adapterObject._id);
1453
- //if uplink decoded => changed State with folder
1454
- let fullStatename = changeInfo?.changedState;
1455
- if (changeInfo?.allElements.length > 6) {
1456
- fullStatename = '';
1457
- for (let i = 5; i < changeInfo?.allElements.length; i++) {
1458
- if (fullStatename !== '') {
1459
- fullStatename += '.';
1434
+ await this.runSerializedMessage(async () => {
1435
+ let myCount = 0;
1436
+ const states = [];
1437
+ const possibleTypes = { state: true };
1438
+ if (obj.command === 'getStatesForConfig') {
1439
+ states[myCount] = { label: '* (Wildcard)', value: '*' };
1440
+ myCount++;
1441
+ possibleTypes.folder = true;
1442
+ }
1443
+ const currentStates = {};
1444
+ const adapterObjects = await this.getAdapterObjectsAsync();
1445
+ for (const adapterObject of Object.values(adapterObjects)) {
1446
+ if (
1447
+ possibleTypes[adapterObject.type] === true &&
1448
+ (adapterObject._id.includes(obj.message.application) ||
1449
+ obj.message.application === '*') &&
1450
+ (adapterObject._id.includes(obj.message.device) || obj.message.device === '*') &&
1451
+ (adapterObject._id.includes(obj.message.folder) ||
1452
+ (obj.message.folder === '*' &&
1453
+ (adapterObject._id.includes('uplink.decoded') ||
1454
+ adapterObject._id.includes('downlink.control'))))
1455
+ ) {
1456
+ //adapterObject._id = this.removeNamespace(adapterObject._id); remooved 30.122025
1457
+ const changeInfo = await this.getChangeInfoCached(adapterObject._id);
1458
+ //if uplink decoded => changed State with folder
1459
+ let fullStatename = changeInfo?.changedState;
1460
+ if (changeInfo?.allElements.length > 6) {
1461
+ fullStatename = '';
1462
+ for (let i = 5; i < changeInfo?.allElements.length; i++) {
1463
+ if (fullStatename !== '') {
1464
+ fullStatename += '.';
1465
+ }
1466
+ fullStatename += changeInfo?.allElements[i];
1460
1467
  }
1461
- fullStatename += changeInfo?.allElements[i];
1462
1468
  }
1463
- }
1464
- if (adapterObject.type === 'folder') {
1465
- fullStatename += '.';
1466
- }
1467
- const label = fullStatename;
1468
- const value = fullStatename;
1469
- if (!currentStates[value]) {
1470
- currentStates[value] = value;
1471
- states[myCount] = { label: label, value: value };
1472
- myCount++;
1469
+ if (adapterObject.type === 'folder') {
1470
+ fullStatename += '.';
1471
+ }
1472
+ const label = fullStatename;
1473
+ const value = fullStatename;
1474
+ if (!currentStates[value]) {
1475
+ currentStates[value] = value;
1476
+ states[myCount] = { label: label, value: value };
1477
+ myCount++;
1478
+ }
1473
1479
  }
1474
1480
  }
1475
- }
1476
- states.sort(this.sortByLabel);
1477
- this.sendTo(obj.from, obj.command, states, obj.callback);
1481
+ states.sort(this.sortByLabel);
1482
+ this.sendTo(obj.from, obj.command, states, obj.callback);
1483
+ });
1478
1484
  } catch (error) {
1479
1485
  this.log.error(error);
1480
1486
  }
@@ -1613,6 +1619,36 @@ class Lorawan extends utils.Adapter {
1613
1619
  }
1614
1620
  return false;
1615
1621
  }
1622
+
1623
+ async runSerializedMessage(fn) {
1624
+ const run = async () => fn();
1625
+
1626
+ // Queue verlängern
1627
+ const next = this._configQueue.then(run, run);
1628
+
1629
+ // Queue immer weiterführen, Fehler schlucken
1630
+ this._configQueue = next.catch(() => {});
1631
+
1632
+ return next;
1633
+ }
1634
+
1635
+ async getChangeInfoCached(id) {
1636
+ const cleanId = this.removeNamespace(id);
1637
+ const now = Date.now();
1638
+
1639
+ const cached = this._changeInfoCache.get(cleanId);
1640
+ if (cached && cached.expires > now) {
1641
+ return cached.value;
1642
+ }
1643
+
1644
+ const value = await this.getChangeInfo(cleanId);
1645
+ this._changeInfoCache.set(cleanId, {
1646
+ value,
1647
+ expires: now + 30_000, // 10 Sekunden
1648
+ });
1649
+
1650
+ return value;
1651
+ }
1616
1652
  }
1617
1653
 
1618
1654
  if (require.main !== module) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iobroker.lorawan",
3
- "version": "1.18.54",
3
+ "version": "1.18.56",
4
4
  "description": "converts the desired lora gateway data to a ioBroker structure",
5
5
  "author": {
6
6
  "name": "BenAhrdt",