iobroker.lorawan 1.6.5 → 1.6.6
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 +15 -15
- package/lib/modules/downlinkConfighandler.js +17 -8
- package/main.js +6 -0
- 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.6.6 (2025-01-27)
|
|
27
|
+
* (BenAhrdt) start with known profiles
|
|
28
|
+
|
|
26
29
|
### 1.6.5 (2025-01-26)
|
|
27
30
|
* (BenAhrdt) export and import downlinkconmfigs with filemanager
|
|
28
31
|
|
package/io-package.json
CHANGED
|
@@ -1,8 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"common": {
|
|
3
3
|
"name": "lorawan",
|
|
4
|
-
"version": "1.6.
|
|
4
|
+
"version": "1.6.6",
|
|
5
5
|
"news": {
|
|
6
|
+
"1.6.6": {
|
|
7
|
+
"en": "start with known profiles",
|
|
8
|
+
"de": "beginnen mit bekannten profilen",
|
|
9
|
+
"ru": "начать с известных профилей",
|
|
10
|
+
"pt": "começar com perfis conhecidos",
|
|
11
|
+
"nl": "beginnen met bekende profielen",
|
|
12
|
+
"fr": "commencer par des profils connus",
|
|
13
|
+
"it": "iniziare con i profili noti",
|
|
14
|
+
"es": "empezar con perfiles conocidos",
|
|
15
|
+
"pl": "zacząć od znanych profili",
|
|
16
|
+
"uk": "початок з відомих профілів",
|
|
17
|
+
"zh-cn": "以已知配置文件开始"
|
|
18
|
+
},
|
|
6
19
|
"1.6.5": {
|
|
7
20
|
"en": "export and import downlinkconmfigs with filemanager",
|
|
8
21
|
"de": "export und import von downlinkconmfigs mit filemanager",
|
|
@@ -80,19 +93,6 @@
|
|
|
80
93
|
"pl": "update eslint",
|
|
81
94
|
"uk": "оновлення eslint",
|
|
82
95
|
"zh-cn": "更新埃斯林特"
|
|
83
|
-
},
|
|
84
|
-
"1.5.7": {
|
|
85
|
-
"en": "change header responsive",
|
|
86
|
-
"de": "wechselkopf-reaktion",
|
|
87
|
-
"ru": "изменения заголовка",
|
|
88
|
-
"pt": "mudança de cabeçalho responsivo",
|
|
89
|
-
"nl": "verandering header responsive",
|
|
90
|
-
"fr": "réponse au changement d'en-tête",
|
|
91
|
-
"it": "cambiamento intestazione reattiva",
|
|
92
|
-
"es": "cambio de encabezado sensible",
|
|
93
|
-
"pl": "zmiana odpowiedzi nagłówka",
|
|
94
|
-
"uk": "зміна спонтана",
|
|
95
|
-
"zh-cn": "更改信头响应"
|
|
96
96
|
}
|
|
97
97
|
},
|
|
98
98
|
"titleLang": {
|
|
@@ -354,7 +354,7 @@
|
|
|
354
354
|
"type": "meta",
|
|
355
355
|
"common": {
|
|
356
356
|
"name": "Downlink files",
|
|
357
|
-
"
|
|
357
|
+
"type": "meta.user"
|
|
358
358
|
},
|
|
359
359
|
"native": {}
|
|
360
360
|
},
|
|
@@ -62,7 +62,7 @@ class downlinkConfighandlerClass {
|
|
|
62
62
|
const activeFunction = 'addAndMergeDownlinkConfigs';
|
|
63
63
|
this.adapter.log.silly(`the standard and configed downlinks will be merged`);
|
|
64
64
|
// Generate Metafolders
|
|
65
|
-
await this.
|
|
65
|
+
await this.generateMetafoldersFromObject(this.metafolders);
|
|
66
66
|
|
|
67
67
|
// Generate downlinks for known Profiles
|
|
68
68
|
this.generateKnownProfiesFromFiles();
|
|
@@ -76,6 +76,11 @@ class downlinkConfighandlerClass {
|
|
|
76
76
|
// check for uploads
|
|
77
77
|
await this.checkForUploads();
|
|
78
78
|
|
|
79
|
+
// Set known Profiles
|
|
80
|
+
for (const profile of Object.values(this.knownProfiles)) {
|
|
81
|
+
this.addDownlinkConfigByType(profile, this.activeDownlinkConfigs);
|
|
82
|
+
}
|
|
83
|
+
|
|
79
84
|
// Check active userconfig
|
|
80
85
|
const adapterId = `system.adapter.${this.adapter.namespace}`;
|
|
81
86
|
const obj = await this.adapter.getForeignObjectAsync(adapterId);
|
|
@@ -102,7 +107,7 @@ class downlinkConfighandlerClass {
|
|
|
102
107
|
await this.adapter.setForeignObjectAsync(adapterId, obj);
|
|
103
108
|
}
|
|
104
109
|
// write known Profiles
|
|
105
|
-
await this.
|
|
110
|
+
await this.writeKnownProfiles(this.knownProfiles);
|
|
106
111
|
|
|
107
112
|
// write downlinkconfig to current folder
|
|
108
113
|
await this.writeCurrentDownlinksconfigs(obj.native.downlinkConfig);
|
|
@@ -116,8 +121,9 @@ class downlinkConfighandlerClass {
|
|
|
116
121
|
* no Parameters needed
|
|
117
122
|
*/
|
|
118
123
|
async generateKnownProfiesFromFiles() {
|
|
119
|
-
const activeFunction = '
|
|
124
|
+
const activeFunction = 'generateKnownProfiesFromFiles';
|
|
120
125
|
try {
|
|
126
|
+
this.adapter.log.silly(`${activeFunction} starts.`);
|
|
121
127
|
// Add standard downlink config if devices not present
|
|
122
128
|
const knownProfiles = this.getJsonArrayFromDirectoryfiles(
|
|
123
129
|
`${this.adapter.adapterDir}${this.deviceProfilesPath}`,
|
|
@@ -138,9 +144,10 @@ class downlinkConfighandlerClass {
|
|
|
138
144
|
/**
|
|
139
145
|
* @param profiles known profiles to write (eg. from lib/module/deviceProfiles)
|
|
140
146
|
*/
|
|
141
|
-
async
|
|
142
|
-
const activeFunction = '
|
|
147
|
+
async writeKnownProfiles(profiles) {
|
|
148
|
+
const activeFunction = 'writeKnownProfiles';
|
|
143
149
|
try {
|
|
150
|
+
this.adapter.log.silly(`${activeFunction} starts.`);
|
|
144
151
|
// Read all files in folder and delete them
|
|
145
152
|
let metadataOfFiles = await this.adapter.readDirAsync(
|
|
146
153
|
this.adapter.namespace,
|
|
@@ -178,6 +185,7 @@ class downlinkConfighandlerClass {
|
|
|
178
185
|
async writeCurrentDownlinksconfigs(downlinkConfig) {
|
|
179
186
|
const activeFunction = 'writeDownlinkconfigs';
|
|
180
187
|
try {
|
|
188
|
+
this.adapter.log.silly(`${activeFunction} starts.`);
|
|
181
189
|
// Read all files in folder and delete them
|
|
182
190
|
let metadataOfFiles = await this.adapter.readDirAsync(
|
|
183
191
|
this.adapter.namespace,
|
|
@@ -212,12 +220,13 @@ class downlinkConfighandlerClass {
|
|
|
212
220
|
/**
|
|
213
221
|
* @param folderObject object wich contains the folderstructure in its elements
|
|
214
222
|
*/
|
|
215
|
-
async
|
|
223
|
+
async generateMetafoldersFromObject(folderObject) {
|
|
216
224
|
const activeFunction = 'generateFoldersFromObject';
|
|
217
225
|
try {
|
|
226
|
+
this.adapter.log.silly(`${activeFunction} starts.`);
|
|
218
227
|
for (const folder of Object.values(folderObject)) {
|
|
219
228
|
if (typeof folder === 'object') {
|
|
220
|
-
this.
|
|
229
|
+
await this.generateMetafoldersFromObject(folder);
|
|
221
230
|
} else {
|
|
222
231
|
await this.adapter.mkdirAsync(this.adapter.namespace, `${folder}`);
|
|
223
232
|
}
|
|
@@ -233,7 +242,7 @@ class downlinkConfighandlerClass {
|
|
|
233
242
|
async checkForUploads() {
|
|
234
243
|
const activeFunction = 'checkForUploads';
|
|
235
244
|
this.adapter.log.silly(`check the upload folder for files`);
|
|
236
|
-
let activeFile = '';
|
|
245
|
+
let activeFile = 'no active file';
|
|
237
246
|
try {
|
|
238
247
|
let metadataOfFiles = await this.adapter.readDirAsync(
|
|
239
248
|
this.adapter.namespace,
|
package/main.js
CHANGED
|
@@ -25,6 +25,7 @@ class Lorawan extends utils.Adapter {
|
|
|
25
25
|
// this.on("objectChange", this.onObjectChange.bind(this));
|
|
26
26
|
this.on('message', this.onMessage.bind(this));
|
|
27
27
|
this.on('unload', this.onUnload.bind(this));
|
|
28
|
+
this.on('fileChange', this.onFileChange.bind(this));
|
|
28
29
|
this.origin = {
|
|
29
30
|
ttn: 'ttn',
|
|
30
31
|
chirpstack: 'chirpstack',
|
|
@@ -34,6 +35,11 @@ class Lorawan extends utils.Adapter {
|
|
|
34
35
|
this.simulation = {};
|
|
35
36
|
}
|
|
36
37
|
|
|
38
|
+
onFileChange(_id, _fileName, _size) {
|
|
39
|
+
// restart adapter after upload
|
|
40
|
+
//this.restart();
|
|
41
|
+
}
|
|
42
|
+
|
|
37
43
|
/**
|
|
38
44
|
* Is called when databases are connected and adapter received configuration.
|
|
39
45
|
*/
|