iobroker.lorawan 1.19.26 → 1.19.27
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 +27 -14
- package/lib/modules/bridge.js +4 -9
- package/main.js +26 -23
- 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.19.27 (2026-01-15)
|
|
27
|
+
* (BenAhrdt) setting internal logging to debug path in bridge and query the json entries
|
|
28
|
+
|
|
26
29
|
### 1.19.26 (2026-01-15)
|
|
27
30
|
* (BenAhrdt) build internal logging
|
|
28
31
|
|
package/io-package.json
CHANGED
|
@@ -1,8 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"common": {
|
|
3
3
|
"name": "lorawan",
|
|
4
|
-
"version": "1.19.
|
|
4
|
+
"version": "1.19.27",
|
|
5
5
|
"news": {
|
|
6
|
+
"1.19.27": {
|
|
7
|
+
"en": "setting internal logging to debug path in bridge and query the json entries",
|
|
8
|
+
"de": "interne protokollierung zum debug-pfad in der brücke einstellen und die json-einträge abfragen",
|
|
9
|
+
"ru": "установка внутренней регистрации для отладки пути в мосту и запроса записей json",
|
|
10
|
+
"pt": "definindo o registro interno para o caminho de depuração na ponte e consultando os itens json",
|
|
11
|
+
"nl": "interne logging instellen op debugpad in de brug en de json-items opvragen",
|
|
12
|
+
"fr": "paramétrer l'enregistrement interne pour déboguer le chemin dans le pont et interroger les entrées de json",
|
|
13
|
+
"it": "impostare logging interno per debug percorso in ponte e query le voci json",
|
|
14
|
+
"es": "establecer registro interno para depurar el camino en puente y consultar las entradas json",
|
|
15
|
+
"pl": "ustawienie wewnętrznego logowania do debugowania ścieżki w moście i zapytanie wpisów json",
|
|
16
|
+
"uk": "встановлення внутрішнього входу в дебюговий шлях в мост і переробити записи json",
|
|
17
|
+
"zh-cn": "设置内部日志以调试桥上的路径并查询 json 条目"
|
|
18
|
+
},
|
|
6
19
|
"1.19.26": {
|
|
7
20
|
"en": "build internal logging",
|
|
8
21
|
"de": "interne protokollierung erstellen",
|
|
@@ -80,19 +93,6 @@
|
|
|
80
93
|
"pl": "dodaj kolor Tryb termperature do konfigu światła obcego",
|
|
81
94
|
"uk": "додати кольоровий режим Termperature до зовнішньої конфігурації світла",
|
|
82
95
|
"zh-cn": "在外光配置中添加颜色"
|
|
83
|
-
},
|
|
84
|
-
"1.19.20": {
|
|
85
|
-
"en": "bugfix virtual ending",
|
|
86
|
-
"de": "bugfix virtuelles ende",
|
|
87
|
-
"ru": "bugfix виртуальная концовка",
|
|
88
|
-
"pt": "finalização virtual do bugfix",
|
|
89
|
-
"nl": "bugfix virtueel einde",
|
|
90
|
-
"fr": "bugfix virtual ending",
|
|
91
|
-
"it": "bugfix virtuale finale",
|
|
92
|
-
"es": "final virtual de bugfix",
|
|
93
|
-
"pl": "wirtualne zakończenie bugfix",
|
|
94
|
-
"uk": "виправлення віртуальних даних",
|
|
95
|
-
"zh-cn": "错误修正虚拟结尾"
|
|
96
96
|
}
|
|
97
97
|
},
|
|
98
98
|
"titleLang": {
|
|
@@ -577,6 +577,19 @@
|
|
|
577
577
|
},
|
|
578
578
|
"native": {}
|
|
579
579
|
},
|
|
580
|
+
{
|
|
581
|
+
"_id": "bridge.debug.logtypes",
|
|
582
|
+
"type": "state",
|
|
583
|
+
"common": {
|
|
584
|
+
"type": "string",
|
|
585
|
+
"role": "json",
|
|
586
|
+
"name": "internal logging types",
|
|
587
|
+
"read": true,
|
|
588
|
+
"write": true,
|
|
589
|
+
"def": "{\"discovery\":false, \"assign\": false}"
|
|
590
|
+
},
|
|
591
|
+
"native": {}
|
|
592
|
+
},
|
|
580
593
|
{
|
|
581
594
|
"_id": "bridge.notification",
|
|
582
595
|
"type": "state",
|
package/lib/modules/bridge.js
CHANGED
|
@@ -1209,7 +1209,7 @@ class bridgeClass {
|
|
|
1209
1209
|
}
|
|
1210
1210
|
}
|
|
1211
1211
|
// Check for logging
|
|
1212
|
-
if (this.adapter.logtypes.
|
|
1212
|
+
if (this.adapter.logtypes.assign) {
|
|
1213
1213
|
this.adapter.log.warn(
|
|
1214
1214
|
`Assign IdStructure for id: ${indexId}. Object: ${JSON.stringify(assignObject[indexId])}`,
|
|
1215
1215
|
);
|
|
@@ -1244,7 +1244,7 @@ class bridgeClass {
|
|
|
1244
1244
|
}
|
|
1245
1245
|
}
|
|
1246
1246
|
// Check for logging
|
|
1247
|
-
if (this.adapter.logtypes.
|
|
1247
|
+
if (this.adapter.logtypes.assign) {
|
|
1248
1248
|
this.adapter.log.warn(
|
|
1249
1249
|
`Assign TopicStructure for Topic: ${indexTopic}. Object: ${JSON.stringify(assignObject[indexTopic])}`,
|
|
1250
1250
|
);
|
|
@@ -1344,11 +1344,6 @@ class bridgeClass {
|
|
|
1344
1344
|
this.adapter.log.silly(`Function ${activeFunction} started.`);
|
|
1345
1345
|
const returnValue = { newDevice: undefined, newId: undefined };
|
|
1346
1346
|
try {
|
|
1347
|
-
let internalLogging = false;
|
|
1348
|
-
// Check for discoverylogging
|
|
1349
|
-
if (this.adapter.logtypes.includes(this.logging.discovery)) {
|
|
1350
|
-
internalLogging = true;
|
|
1351
|
-
}
|
|
1352
1347
|
if (!DiscoveryObject.lastDiscover) {
|
|
1353
1348
|
DiscoveryObject.lastDiscover = {};
|
|
1354
1349
|
}
|
|
@@ -1366,7 +1361,7 @@ class bridgeClass {
|
|
|
1366
1361
|
// in case of delete entity => setting paylod = ''
|
|
1367
1362
|
// check for new device discovered, or new Id discovered
|
|
1368
1363
|
if (typeof DiscoveryObject.payload !== 'string') {
|
|
1369
|
-
if (
|
|
1364
|
+
if (this.adapter.logtypes.discovery) {
|
|
1370
1365
|
this.adapter.log.warn(
|
|
1371
1366
|
`Discover id: ${id} with Discoveryobject: ${JSON.stringify(DiscoveryObject)}`,
|
|
1372
1367
|
);
|
|
@@ -1407,7 +1402,7 @@ class bridgeClass {
|
|
|
1407
1402
|
returnValue.newId = DiscoveryObject;
|
|
1408
1403
|
}
|
|
1409
1404
|
} else {
|
|
1410
|
-
if (
|
|
1405
|
+
if (this.adapter.logtypes.discovery) {
|
|
1411
1406
|
this.adapter.log.warn(`Delete discover for id: ${id}`);
|
|
1412
1407
|
}
|
|
1413
1408
|
}
|
package/main.js
CHANGED
|
@@ -56,7 +56,7 @@ class Lorawan extends utils.Adapter {
|
|
|
56
56
|
this._adapterObjectsCache = null;
|
|
57
57
|
|
|
58
58
|
// Internal Logging Table
|
|
59
|
-
this.logtypes =
|
|
59
|
+
this.logtypes = {};
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
onFileChange(_id, _fileName, _size) {
|
|
@@ -71,12 +71,8 @@ class Lorawan extends utils.Adapter {
|
|
|
71
71
|
const activeFunction = 'onReady';
|
|
72
72
|
try {
|
|
73
73
|
// Get Logtypes
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
if (logtypes && typeof logtypes.val === 'string') {
|
|
77
|
-
this.logtypes = JSON.parse(logtypes.val);
|
|
78
|
-
}
|
|
79
|
-
}
|
|
74
|
+
this.logtypes = JSON.parse(await this.setDefIfEmptyAndReturnVal('bridge.debug.logtypes'));
|
|
75
|
+
|
|
80
76
|
// read system translation out of i18n translation
|
|
81
77
|
this.i18nTranslation = await this.geti18nTranslation();
|
|
82
78
|
|
|
@@ -150,6 +146,28 @@ class Lorawan extends utils.Adapter {
|
|
|
150
146
|
.digest('hex');
|
|
151
147
|
}
|
|
152
148
|
|
|
149
|
+
/**
|
|
150
|
+
* CHeck Id for '' and set to def, if preset
|
|
151
|
+
*
|
|
152
|
+
* @param id id to check for empty
|
|
153
|
+
*/
|
|
154
|
+
async setDefIfEmptyAndReturnVal(id) {
|
|
155
|
+
if (await this.objectExists(id)) {
|
|
156
|
+
const stateOfId = await this.getStateAsync(id);
|
|
157
|
+
if (stateOfId && typeof stateOfId.val) {
|
|
158
|
+
if (stateOfId.val === '') {
|
|
159
|
+
const objectOfId = await this.getObjectAsync(id);
|
|
160
|
+
if (objectOfId?.common.def) {
|
|
161
|
+
await this.setState(id, objectOfId?.common.def, true);
|
|
162
|
+
return objectOfId?.common.def;
|
|
163
|
+
}
|
|
164
|
+
} else {
|
|
165
|
+
return stateOfId.val;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
|
|
153
171
|
async geti18nTranslation() {
|
|
154
172
|
const systemConfig = await this.getForeignObjectAsync('system.config');
|
|
155
173
|
if (systemConfig) {
|
|
@@ -852,21 +870,6 @@ class Lorawan extends utils.Adapter {
|
|
|
852
870
|
native: {},
|
|
853
871
|
});
|
|
854
872
|
await this.setState(id, '', true);
|
|
855
|
-
} else if (words[1] === 'logging') {
|
|
856
|
-
this.extendObject('bridge.debug.logtypes', {
|
|
857
|
-
type: 'state',
|
|
858
|
-
common: {
|
|
859
|
-
name: 'topic of mqtt message',
|
|
860
|
-
type: 'string',
|
|
861
|
-
role: 'json',
|
|
862
|
-
read: true,
|
|
863
|
-
write: true,
|
|
864
|
-
desc: 'Possible array entries eg.: ["discovery", "assign"]',
|
|
865
|
-
def: '',
|
|
866
|
-
},
|
|
867
|
-
native: {},
|
|
868
|
-
});
|
|
869
|
-
await this.setState(id, '', true);
|
|
870
873
|
}
|
|
871
874
|
} else {
|
|
872
875
|
let notificationId = `${this.namespace}.${this.bridge?.Words.notification}${this.bridge?.GeneralId}`;
|
|
@@ -905,8 +908,8 @@ class Lorawan extends utils.Adapter {
|
|
|
905
908
|
await this.setState(id, state.val, true);
|
|
906
909
|
}
|
|
907
910
|
} else if (id.endsWith('bridge.debug.logtypes')) {
|
|
908
|
-
this.logtypes = JSON.parse(state.val);
|
|
909
911
|
await this.setState(id, state.val, true);
|
|
912
|
+
this.logtypes = JSON.parse(await this.setDefIfEmptyAndReturnVal(id));
|
|
910
913
|
}
|
|
911
914
|
} else {
|
|
912
915
|
// Query for 0_userdata or alias => states also publish with ack = false
|