iobroker.lorawan 0.3.9 → 0.4.0

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
@@ -22,6 +22,12 @@ For now there is documentation in English here: http://www.hafenmeister.com/Lora
22
22
  Placeholder for the next version (at the beginning of the line):
23
23
  ### **WORK IN PROGRESS**
24
24
  -->
25
+ ### 0.4.0 (2024-02-26)
26
+ * (BenAhrdt) searchallgorythm improoved, defaultvalues changed, remove query for "all"
27
+
28
+ ### 0.3.10 (2024-02-25)
29
+ * (BenAhrdt) change logging again if a device joined the network
30
+
25
31
  ### 0.3.9 (2024-02-25)
26
32
  * (BenAhrdt) change logging if a device joined the network
27
33
 
@@ -140,8 +140,8 @@
140
140
  "label": "portDownlink",
141
141
  "tooltip": "portDownlinkTooltip",
142
142
  "hidden": "data.sendWithUplink === 'disabled'",
143
- "default": 2,
144
- "sm":2
143
+ "default": 1,
144
+ "sm":1
145
145
  },
146
146
  {
147
147
  "type": "text",
package/io-package.json CHANGED
@@ -1,8 +1,34 @@
1
1
  {
2
2
  "common": {
3
3
  "name": "lorawan",
4
- "version": "0.3.9",
4
+ "version": "0.4.0",
5
5
  "news": {
6
+ "0.4.0": {
7
+ "en": "searchallgorythm improoved, defaultvalues changed, remove query for \"all\"",
8
+ "de": "searchallgorythm improoved, standardwerte geändert, entfernen abfrage für \"all\"",
9
+ "ru": "searchallgorythm сброшен, изменены значения по умолчанию, удален запрос \"все\"",
10
+ "pt": "searchallgorythm improoved, defaultvalues alterado, remover consulta para \"all\"",
11
+ "nl": "searchallgorythm improoved, defaultvalues veranderd, query verwijderen voor \"all\"",
12
+ "fr": "searchallgorythm improoved, valeurs par défaut changé, supprimer la requête pour \"all\"",
13
+ "it": "ricercaallgorythm improoved, valori di default modificati, rimuovere la query per \"tutti\"",
14
+ "es": "searchallgorythm improvisado, valores predeterminados cambiaron, eliminar la consulta para \"todo\"",
15
+ "pl": "searchogorythm improused, defaultvalues changed, remove query for \"all\"",
16
+ "uk": "searchallgorythm improoved, типові значення змінені, видалення запиту для \"all\"",
17
+ "zh-cn": "搜索所有未启动的理论, 默认值已更改, 删除“ 所有” 的查询"
18
+ },
19
+ "0.3.10": {
20
+ "en": "change logging again if a device joined the network",
21
+ "de": "erneute protokollierung ändern, wenn ein gerät dem netzwerk angeschlossen ist",
22
+ "ru": "изменить журнализацию снова, если устройство вступило в сеть",
23
+ "pt": "mudar o registro novamente se um dispositivo entrou na rede",
24
+ "nl": "loggen opnieuw wijzigen als een apparaat zich aan het netwerk heeft aangesloten",
25
+ "fr": "changer de journalisation si un périphérique a rejoint le réseau",
26
+ "it": "modificare la registrazione di nuovo se un dispositivo è entrato nella rete",
27
+ "es": "cambiar de registro de nuevo si un dispositivo se unió a la red",
28
+ "pl": "zmiana logowania w przypadku połączenia urządzenia z siecią",
29
+ "uk": "перезавантаження знову, якщо пристрій долучився до мережі",
30
+ "zh-cn": "如果设备加入了网络, 将再次更改记录"
31
+ },
6
32
  "0.3.9": {
7
33
  "en": "change logging if a device joined the network",
8
34
  "de": "änderung der protokollierung, wenn ein gerät im netzwerk angeschlossen ist",
@@ -67,32 +93,6 @@
67
93
  "pl": "ustawić poziom dokładności na 2 i improove standardowe urządzenia",
68
94
  "uk": "встановити ярус до 2 і непровисних стандартних пристроїв",
69
95
  "zh-cn": "设置等级至 2 级, 并且不包含标准设备"
70
- },
71
- "0.3.4": {
72
- "en": "put some debug and silly logging to code",
73
- "de": "debug und silly logging auf code setzen",
74
- "ru": "положить некоторые отладки и глупые журналы для кодирования",
75
- "pt": "colocar algum debug e log tonto para o código",
76
- "nl": "zet wat debug en dom loggen op code",
77
- "fr": "mettre un peu de débogage et stupide log pour coder",
78
- "it": "mettere alcuni debug e stupido registrazione al codice",
79
- "es": "poner un poco de depuración y registro tonto para el código",
80
- "pl": "dodaj debug i głupie logowanie do kodu",
81
- "uk": "покласти деякі debug і silly журналювання до коду",
82
- "zh-cn": "把一些调试和愚蠢的日志输入代码"
83
- },
84
- "0.3.3": {
85
- "en": "set infos into native",
86
- "de": "informationen in die heimat",
87
- "ru": "установить информацию на родной",
88
- "pt": "definir informações em nativo",
89
- "nl": "info's instellen in native",
90
- "fr": "définir les infos dans native",
91
- "it": "impostare le informazioni in nativo",
92
- "es": "set infos into native",
93
- "pl": "zestaw infos do rodzimej",
94
- "uk": "встановити інформацію на рідні",
95
- "zh-cn": "设置为本地信息"
96
96
  }
97
97
  },
98
98
  "title": "LoRaWAN",
@@ -165,13 +165,13 @@
165
165
  "password"
166
166
  ],
167
167
  "native": {
168
- "ipUrl": "",
168
+ "ipUrl": "eu1.cloud.thethings.network",
169
169
  "port": 8883,
170
170
  "username": "",
171
171
  "password": "",
172
172
  "ssl": true,
173
173
  "origin": "ttn",
174
- "downlinkConfig": {}
174
+ "downlinkConfig": []
175
175
  },
176
176
  "objects": [],
177
177
  "instanceObjects": [
@@ -5,13 +5,11 @@
5
5
  "downlinkParameter":[
6
6
  {
7
7
  "name": "push",
8
- "type": "json",
9
- "deviceType": "all"
8
+ "type": "json"
10
9
  },
11
10
  {
12
11
  "name": "replace",
13
- "type": "json",
14
- "deviceType": "all"
12
+ "type": "json"
15
13
  }
16
14
  ]
17
15
  }
@@ -73,7 +73,8 @@ class downlinkConfighandlerClass {
73
73
  }
74
74
  }
75
75
  // Sort Array by Alphabet
76
- ownConfig.sort((a, b) => a.deviceType.toLowerCase() > b.deviceType.toLowerCase()?1:-1);
76
+ //ownConfig.sort((a, b) => a.deviceType.toLowerCase() > b.deviceType.toLowerCase()?1:-1);
77
+ // Check if equal
77
78
  if(!isDeepStrictEqual(obj.native.downlinkConfig,ownConfig)){
78
79
  obj.native.downlinkConfig = ownConfig;
79
80
  this.adapter.log.warn("Adapter restart, because of reinit configuration");
@@ -140,11 +141,9 @@ class downlinkConfighandlerClass {
140
141
  let foundMatch = "";
141
142
  let foundLength = 0;
142
143
  for(const deviceType in this.activeDownlinkConfigs){
143
- if((deviceType === "all" || deviceType === this.internalDevices.baseDevice || changeInfo.deviceType.indexOf(deviceType) === 0) && deviceType.length > foundLength){
144
- if(foundLength === 0){
145
- foundMatch = deviceType;
146
- }
147
- if(deviceType !== "all" && deviceType !== this.internalDevices.baseDevice){
144
+ if((deviceType === this.internalDevices.baseDevice && foundLength === 0) || (changeInfo.deviceType.indexOf(deviceType) === 0 && deviceType.length > foundLength)){
145
+ foundMatch = deviceType;
146
+ if(deviceType !== this.internalDevices.baseDevice){
148
147
  foundLength = deviceType.length;
149
148
  }
150
149
  }
@@ -168,10 +167,10 @@ class downlinkConfighandlerClass {
168
167
  let downlinkParameter = undefined;
169
168
  let foundLength = 0;
170
169
  for(const deviceType in this.activeDownlinkConfigs){
171
- if((deviceType === "all" || deviceType === this.internalDevices.baseDevice || changeInfo.deviceType.indexOf(deviceType) === 0) && deviceType.length > foundLength){
170
+ if((deviceType === this.internalDevices.baseDevice && foundLength === 0) || (changeInfo.deviceType.indexOf(deviceType) === 0 && deviceType.length > foundLength)){
172
171
  if(this.activeDownlinkConfigs[deviceType].downlinkState[changeInfo.changedState]){
173
172
  downlinkParameter = this.activeDownlinkConfigs[deviceType].downlinkState[changeInfo.changedState];
174
- if(deviceType !== "all" && deviceType !== this.internalDevices.baseDevice){
173
+ if(deviceType !== this.internalDevices.baseDevice){
175
174
  foundLength = deviceType.length;
176
175
  }
177
176
  }
@@ -71,7 +71,7 @@ class messagehandlerClass {
71
71
  //iterate downlinkDevice
72
72
  for(const downlinkDevice in this.adapter.downlinkConfighandler.activeDownlinkConfigs){
73
73
  // query for match deviceType
74
- if((downlinkDevice === "all" || downlinkDevice === this.adapter.downlinkConfighandler.internalDevices.baseDevice || changeInfo.deviceType.indexOf(downlinkDevice) === 0)){
74
+ if((downlinkDevice === this.adapter.downlinkConfighandler.internalDevices.baseDevice || changeInfo.deviceType.indexOf(downlinkDevice) === 0)){
75
75
  // iterate downlinkConfig
76
76
  for(const downlinkParameter of Object.values(this.adapter.downlinkConfighandler.activeDownlinkConfigs[downlinkDevice].downlinkState)){
77
77
  this.adapter.log.silly(`the downlinkparameter ${JSON.stringify(downlinkParameter)}, will be checked.`);
@@ -114,7 +114,7 @@ class messagehandlerClass {
114
114
  }
115
115
  if(downlinkParameter.limitMax){
116
116
  stateCommonMax = downlinkParameter.limitMaxValue;
117
- if(stateCommonMax > stateCommonDef){
117
+ if(stateCommonMax < stateCommonDef){
118
118
  stateCommonDef = stateCommonMax;
119
119
  }
120
120
  }
@@ -140,7 +140,7 @@ class messagehandlerClass {
140
140
  common: common,
141
141
  native: {},
142
142
  });
143
- if(downlinkDevice !=="all" && downlinkDevice !== this.adapter.downlinkConfighandler.internalDevices.baseDevice){
143
+ if(downlinkDevice !== this.adapter.downlinkConfighandler.internalDevices.baseDevice){
144
144
  foundLength[downlinkParameter.name] = downlinkDevice.length;
145
145
  }
146
146
  //check for right type of data (after a possible change)
@@ -436,7 +436,7 @@ class messagehandlerClass {
436
436
  });
437
437
  await this.adapter.setStateAsync(`${startId}.json`,JSON.stringify(message),true);
438
438
  const changeInfo = await this.adapter.getChangeInfo(startId);
439
- this.adapter.log.info(`the device ${changeInfo.deviceEUI}, with the name ${changeInfo.deviceId} joined network at application ${changeInfo.applicationId} (${changeInfo.applicationName})`);
439
+ this.adapter.log.info(`the device ${changeInfo.deviceEUI} (${changeInfo.deviceId}) joined network at application ${changeInfo.applicationId} (${changeInfo.applicationName})`);
440
440
  }
441
441
  // Other messagetypes
442
442
  else{
@@ -715,7 +715,7 @@ class messagehandlerClass {
715
715
  });
716
716
  await this.adapter.setStateAsync(`${startId}.json`,JSON.stringify(message),true);
717
717
  const changeInfo = await this.adapter.getChangeInfo(startId);
718
- this.adapter.log.info(`the device ${changeInfo.deviceEUI}, with the name ${changeInfo.deviceId} joined network at application ${changeInfo.applicationId} (${changeInfo.applicationName})`);
718
+ this.adapter.log.info(`the device ${changeInfo.deviceEUI} (${changeInfo.deviceId}) joined network at application ${changeInfo.applicationId} (${changeInfo.applicationName})`);
719
719
  }
720
720
  // Other messagetypes
721
721
  else{
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iobroker.lorawan",
3
- "version": "0.3.9",
3
+ "version": "0.4.0",
4
4
  "description": "converts the desired lora gateway data to a ioBroker structure",
5
5
  "author": {
6
6
  "name": "BenAhrdt",