iobroker.lorawan 0.0.4 → 0.0.5
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 -1
- package/lib/modules/downlinkConfig.js +12 -10
- package/lib/modules/downlinks/downlinks.js +1 -1
- package/lib/modules/messagehandler.js +14 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -19,6 +19,9 @@ Adapter was created in collaboration with Joerg Froehner J-Paul0815@hafenmeister
|
|
|
19
19
|
Placeholder for the next version (at the beginning of the line):
|
|
20
20
|
### **WORK IN PROGRESS**
|
|
21
21
|
-->
|
|
22
|
+
### 0.0.5 (2024-01-15)
|
|
23
|
+
* (BenAhrdt) delete not configed states at startup
|
|
24
|
+
|
|
22
25
|
### 0.0.4 (2024-01-15)
|
|
23
26
|
* (BenAhrdt) implements buttons and standard downlink control ind json (push / replace)
|
|
24
27
|
|
package/io-package.json
CHANGED
|
@@ -1,8 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"common": {
|
|
3
3
|
"name": "lorawan",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.5",
|
|
5
5
|
"news": {
|
|
6
|
+
"0.0.5": {
|
|
7
|
+
"en": "delete not configed states at startup",
|
|
8
|
+
"de": "nicht konfiszierte staaten beim start löschen",
|
|
9
|
+
"ru": "удалить не настроенные состояния при запуске",
|
|
10
|
+
"pt": "excluir estados não configurados na inicialização",
|
|
11
|
+
"nl": "verwijderde niet-geconfigeerde toestanden bij opstarten",
|
|
12
|
+
"fr": "supprimer les états non configurés au démarrage",
|
|
13
|
+
"it": "delete not configed stati all'avvio",
|
|
14
|
+
"es": "eliminar estados no confiados al inicio",
|
|
15
|
+
"pl": "usuń nieskonfigurowane stany przy starcie",
|
|
16
|
+
"uk": "видалити не налаштовані стани при запуску",
|
|
17
|
+
"zh-cn": "删除启动时未配置状态"
|
|
18
|
+
},
|
|
6
19
|
"0.0.4": {
|
|
7
20
|
"en": "implements buttons and standard downlink control ind json (push / replace)",
|
|
8
21
|
"de": "implementiert tasten und standard-downlink-steuerung ind json (push / ersetzen)",
|
|
@@ -31,19 +31,21 @@ class downlinkConfigClass {
|
|
|
31
31
|
getDownlinkConfig(changeInfo){
|
|
32
32
|
const activeFunction = "getDownlinkConfig";
|
|
33
33
|
try{
|
|
34
|
-
|
|
34
|
+
let downlinkConfig = undefined;
|
|
35
|
+
for(const deviceType in this.activeDownlinkConfigs){
|
|
36
|
+
if(changeInfo.deviceType.indexOf(deviceType) === 0 || deviceType === "all"){
|
|
37
|
+
if(this.activeDownlinkConfigs[deviceType][changeInfo.changedState]){
|
|
38
|
+
downlinkConfig = this.activeDownlinkConfigs[deviceType][changeInfo.changedState];
|
|
39
|
+
break;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
if(downlinkConfig !== undefined)
|
|
35
44
|
{
|
|
36
|
-
return
|
|
45
|
+
return downlinkConfig;
|
|
37
46
|
}
|
|
38
47
|
else{
|
|
39
|
-
changeInfo.deviceType
|
|
40
|
-
if(this.activeDownlinkConfigs[changeInfo.deviceType] && this.activeDownlinkConfigs[changeInfo.deviceType][changeInfo.changedState])
|
|
41
|
-
{
|
|
42
|
-
return this.activeDownlinkConfigs[changeInfo.deviceType][changeInfo.changedState];
|
|
43
|
-
}
|
|
44
|
-
else{
|
|
45
|
-
this.adapter.log.warn(`${activeFunction}: no downlinkConfig found: deviceType: ${changeInfo.deviceType} - changed state: ${changeInfo.changedState}`);
|
|
46
|
-
}
|
|
48
|
+
this.adapter.log.warn(`${activeFunction}: no downlinkConfig found: deviceType: ${changeInfo.deviceType} - changed state: ${changeInfo.changedState}`);
|
|
47
49
|
}
|
|
48
50
|
}
|
|
49
51
|
catch(error){
|
|
@@ -294,9 +294,20 @@ class messagehandlerClass {
|
|
|
294
294
|
async generateDownlinkstatesAtStatup(){
|
|
295
295
|
const adapterObjectsAtStart = await this.adapter.getAdapterObjectsAsync();
|
|
296
296
|
for(const adapterObject of Object.values(adapterObjectsAtStart)){
|
|
297
|
-
if(adapterObject.type === "channel" && adapterObject.common.name
|
|
298
|
-
|
|
299
|
-
await this.fillWithDownloadconfig(
|
|
297
|
+
if(adapterObject.type === "channel" && adapterObject.common.name !== "Information"){
|
|
298
|
+
const stateId = this.adapter.removeNamespace(adapterObject._id);
|
|
299
|
+
await this.fillWithDownloadconfig(stateId);
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
// remove not configed states
|
|
304
|
+
for(const adapterObject of Object.values(adapterObjectsAtStart)){
|
|
305
|
+
if(adapterObject.type === "state" && (adapterObject._id.indexOf("downlink.control") !== -1 || adapterObject._id.indexOf("downlink.configuration") !== -1)){
|
|
306
|
+
const changeInfo = await this.adapter.getChangeInfo(adapterObject._id);
|
|
307
|
+
const downlinkConfig = this.adapter.downlinkConfig.getDownlinkConfig(changeInfo);
|
|
308
|
+
if(!downlinkConfig){
|
|
309
|
+
this.adapter.delObjectAsync(this.adapter.removeNamespace(adapterObject._id));
|
|
310
|
+
}
|
|
300
311
|
}
|
|
301
312
|
}
|
|
302
313
|
}
|