iobroker.lorawan 1.16.1 → 1.16.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 CHANGED
@@ -23,6 +23,12 @@ 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.16.3 (2025-09-16)
27
+ * (BenAhrdt) nameing of foreign Devices in Bridge
28
+
29
+ ### 1.16.2 (2025-09-16)
30
+ * (BenAhrdt) bugfix namespace also by calling work from directoryhandler
31
+
26
32
  ### 1.16.1 (2025-09-16)
27
33
  * (BenAhrdt) bugfix namespace also by notifications
28
34
 
package/io-package.json CHANGED
@@ -1,8 +1,34 @@
1
1
  {
2
2
  "common": {
3
3
  "name": "lorawan",
4
- "version": "1.16.1",
4
+ "version": "1.16.3",
5
5
  "news": {
6
+ "1.16.3": {
7
+ "en": "nameing of foreign Devices in Bridge",
8
+ "de": "Benennung von fremden Geräten in der Brücke",
9
+ "ru": "Наименование иностранных устройств в мосту",
10
+ "pt": "Nomenclatura de Dispositivos Estrangeiros na Ponte",
11
+ "nl": "Benaming van externe apparaten in de bridge",
12
+ "fr": "Renommage des appareils étrangers dans le pont",
13
+ "it": "Nominativo dei dispositivi stranieri nel Bridge",
14
+ "es": "Renombrar dispositivos extranjeros en el puente",
15
+ "pl": "Nadanie nazw obcym urządzeniom w mostku",
16
+ "uk": "Перейменування зовнішніх пристроїв у мосту",
17
+ "zh-cn": "在网桥中给外部设备命名"
18
+ },
19
+ "1.16.2": {
20
+ "en": "bugfix namespace also by calling work from directoryhandler",
21
+ "de": "Bug behoben: Namensraum auch durch Aufruf von \"Arbeit\" von DirectoryHandler.",
22
+ "ru": "исправлена ошибка с пространством имен путем вызова работы из directoryhandler",
23
+ "pt": "Corrigido bug ao chamar namespace também utilizando o trabalho do directoryhandler.",
24
+ "nl": "Bugfix: Namespace wordt nu ook correct opgeroepen bij het gebruik van werk van DirectoryHandler.",
25
+ "fr": "Correction de bug du namespace également en appelant le travail du gestionnaire de répertoires.",
26
+ "it": "Correzione di bug anche chiamando il lavoro dal gestore della directory.",
27
+ "es": "Corrección de error en el espacio de nombres al llamar al trabajo desde directoryhandler",
28
+ "pl": "Poprawka błędu: przestrzeń nazw również wywoływana przez funkcję work z directoryhandler",
29
+ "uk": "виправлено помилку у просторі імен також шляхом виклику роботи з обробника директорій",
30
+ "zh-cn": "通过调用`directoryhandler`来修复了`namespace`问题。"
31
+ },
6
32
  "1.16.1": {
7
33
  "en": "bugfix namespace also by notifications",
8
34
  "de": "Fehlerbehebung Namespace auch bei Benachrichtigungen",
@@ -67,32 +93,6 @@
67
93
  "pl": "Poprawiono obsługę urządzenia stanu w przypadku podfolderów.",
68
94
  "uk": "Поліпшено обробку пристрою стану у випадку підпапок.",
69
95
  "zh-cn": "改进对子文件夹中状态设备的处理"
70
- },
71
- "1.15.5": {
72
- "en": "Bugfix logging removed",
73
- "de": "Fehlerbehebung beim Protokollieren entfernt",
74
- "ru": "Исправлена ошибка с удалением журнала.",
75
- "pt": "Correção de bug: log removido",
76
- "nl": "Bugfix logging verwijderd",
77
- "fr": "Correctif de bug: suppression du journalisation",
78
- "it": "Rimossa la registrazione dei bugfix",
79
- "es": "Corregido el registro de errores.",
80
- "pl": "Usunięto logowanie błędów",
81
- "uk": "Виправлено запис журналів про помилки",
82
- "zh-cn": "修复了日志记录问题"
83
- },
84
- "1.15.4": {
85
- "en": "Bugfix send state topics retain\nBugfix with stateending",
86
- "de": "Fehlerbehebung für das Beibehalten der Zustandsthemen beim Senden\nFehlerbehebung beim Zustandsende",
87
- "ru": "Исправлена ошибка с сохранением тем состояний при отправке\nИсправлена ошибка со stateending",
88
- "pt": "Correção de bug: envio de tópicos de estado mantendo a retenção.\nCorreção de bug com stateending",
89
- "nl": "Bugfix stuurstatus onderwerpen behouden\nBugfix met stateending",
90
- "fr": "Correction de bug pour conserver les sujets des états envoyés\nCorrection de bug avec stateEnding",
91
- "it": "Risoluzione di bug per la conservazione dei topic di invio degli stati\nCorrezione di bug con stateending.",
92
- "es": "Corrección de error en la retención de temas al enviar estados\nCorrección de error con state ending",
93
- "pl": "Naprawiono błąd z zachowaniem tematów stanów wysyłanych.\nPoprawka błędu dotycząca kończenia stanu",
94
- "uk": "Виправлено помилку збереження тем для відправлення стану\nВиправлено помилку з порядком стану",
95
- "zh-cn": "修复发送状态主题时的保留问题\n修复了和状态结尾相关的问题"
96
96
  }
97
97
  },
98
98
  "titleLang": {
@@ -1484,15 +1484,21 @@ class bridgeClass {
1484
1484
  this.adapter.log.debug(`Function ${activeFunction} started.`);
1485
1485
  try {
1486
1486
  const state = await this.adapter.getForeignStateAsync(id);
1487
- const parentObject = await this.getParentObject(id);
1488
1487
  let partentId = '';
1489
1488
  let parentName = '';
1490
- if (typeof parentObject === 'object') {
1491
- partentId = parentObject._id;
1492
- parentName = parentObject.common.name;
1489
+ const parentDevice = await this.getParentDevice(id);
1490
+ if (typeof parentDevice === 'string') {
1491
+ const parentChannel = await this.getParentChannel(id);
1492
+ if (typeof parentChannel === 'string') {
1493
+ partentId = parentChannel;
1494
+ parentName = partentId;
1495
+ } else {
1496
+ partentId = parentChannel._id;
1497
+ parentName = parentChannel.common.name;
1498
+ }
1493
1499
  } else {
1494
- partentId = parentObject;
1495
- parentName = partentId;
1500
+ partentId = parentDevice._id;
1501
+ parentName = parentDevice.common.name;
1496
1502
  }
1497
1503
  const deviceIdentifier = parentName;
1498
1504
  const statename = id.substring(partentId.length + 1, id.length);
@@ -1562,31 +1568,50 @@ class bridgeClass {
1562
1568
  }
1563
1569
 
1564
1570
  /**
1565
- * @param id id to get parent Object
1571
+ * @param id id to get parent Channel
1566
1572
  */
1567
- async getParentObject(id) {
1568
- const activeFunction = 'bridge.js - getParentObject';
1573
+ async getParentDevice(id) {
1574
+ const activeFunction = 'bridge.js - getParentDevice';
1569
1575
  this.adapter.log.debug(`Function ${activeFunction} started.`);
1570
1576
  try {
1571
1577
  const firstIdexOfDot = id.indexOf('.');
1572
1578
  const lastIdexOfDot = id.lastIndexOf('.');
1573
1579
  if (lastIdexOfDot > firstIdexOfDot + 3) {
1574
1580
  id = id.substring(0, lastIdexOfDot);
1575
- const firstObj = await this.adapter.getForeignObjectAsync(id);
1576
- if (!firstObj) {
1581
+ const obj = await this.adapter.getForeignObjectAsync(id);
1582
+ if (!obj) {
1577
1583
  return undefined;
1578
1584
  }
1579
- if (firstObj?.type === 'device') {
1580
- return firstObj;
1585
+ if (obj?.type === 'device') {
1586
+ return obj;
1581
1587
  }
1582
- if (firstObj.type === 'channel') {
1583
- const secondObj = await this.getParentObject(id);
1584
- if (secondObj !== undefined) {
1585
- return secondObj;
1586
- }
1587
- return firstObj;
1588
+ return await this.getParentDevice(id);
1589
+ }
1590
+ return id.substring(0, lastIdexOfDot);
1591
+ } catch (error) {
1592
+ this.adapter.log.error(`error at ${activeFunction}: ${error}`);
1593
+ }
1594
+ }
1595
+
1596
+ /**
1597
+ * @param id id to get parent Channel
1598
+ */
1599
+ async getParentChannel(id) {
1600
+ const activeFunction = 'bridge.js - getParentChannel';
1601
+ this.adapter.log.debug(`Function ${activeFunction} started.`);
1602
+ try {
1603
+ const firstIdexOfDot = id.indexOf('.');
1604
+ const lastIdexOfDot = id.lastIndexOf('.');
1605
+ if (lastIdexOfDot > firstIdexOfDot + 3) {
1606
+ id = id.substring(0, lastIdexOfDot);
1607
+ const obj = await this.adapter.getForeignObjectAsync(id);
1608
+ if (!obj) {
1609
+ return undefined;
1610
+ }
1611
+ if (obj?.type === 'channel') {
1612
+ return obj;
1588
1613
  }
1589
- return await this.getParentObject(id);
1614
+ return await this.getParentChannel(id);
1590
1615
  }
1591
1616
  return id.substring(0, lastIdexOfDot);
1592
1617
  } catch (error) {
@@ -495,7 +495,9 @@ class directorieshandlerClass {
495
495
  });
496
496
  // Add Bridged Funktion (MQTT auto discovery)
497
497
  // Add for new state
498
- await this.adapter.bridge?.work(objectId, stateVal, { common: common });
498
+ await this.adapter.bridge?.work(`${this.adapter.namespace}.${objectId}`, stateVal, {
499
+ common: common,
500
+ });
499
501
  if (typeof stateVal === 'object') {
500
502
  stateVal = JSON.stringify(stateVal);
501
503
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iobroker.lorawan",
3
- "version": "1.16.1",
3
+ "version": "1.16.3",
4
4
  "description": "converts the desired lora gateway data to a ioBroker structure",
5
5
  "author": {
6
6
  "name": "BenAhrdt",