iobroker.lorawan 0.4.1 → 0.5.1

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.5.1 (2024-02-29)
26
+ * (BenAhrdt) detecting of triggerwords changed
27
+
28
+ ### 0.5.0 (2024-02-28)
29
+ * (BenAhrdt) trigger for devicetype implemented
30
+
25
31
  ### 0.4.1 (2024-02-26)
26
32
  * (BenAhrdt) implement new deviceprofiles
27
33
 
package/io-package.json CHANGED
@@ -1,8 +1,34 @@
1
1
  {
2
2
  "common": {
3
3
  "name": "lorawan",
4
- "version": "0.4.1",
4
+ "version": "0.5.1",
5
5
  "news": {
6
+ "0.5.1": {
7
+ "en": "detecting of triggerwords changed",
8
+ "de": "erkennung von triggerworten geändert",
9
+ "ru": "изменено обнаружение триггеров",
10
+ "pt": "detecção de palavras de gatilho alteradas",
11
+ "nl": "detectie van gewijzigde triggerwoorden",
12
+ "fr": "la détection des mots-clés a changé",
13
+ "it": "rilevazione delle parole d'innesco modificate",
14
+ "es": "detección de palabras de disparador cambiadas",
15
+ "pl": "wykrywanie zmienionych tryggerwords",
16
+ "uk": "виявлення змінених фраз",
17
+ "zh-cn": "检测触发词已更改"
18
+ },
19
+ "0.5.0": {
20
+ "en": "trigger for devicetype implemented",
21
+ "de": "trigger für implementierte gerätetypen",
22
+ "ru": "триггер для реализованного устройства",
23
+ "pt": "gatilho para o tipo de dispositivo implementado",
24
+ "nl": "trigger voor apparaattype geïmplementeerd",
25
+ "fr": "déclencheur pour le type d'appareil implémenté",
26
+ "it": "trigger per il tipo di dispositivo implementato",
27
+ "es": "disparador para el tipo de dispositivo implementado",
28
+ "pl": "wyzwalacz dla wdrożonego typu devicetype",
29
+ "uk": "тригер для установки",
30
+ "zh-cn": "已执行设备类型的触发器"
31
+ },
6
32
  "0.4.1": {
7
33
  "en": "implement new deviceprofiles",
8
34
  "de": "neue geräteprofile implementieren",
@@ -67,32 +93,6 @@
67
93
  "pl": "zapis def do stanu w przypadku zmian typu",
68
94
  "uk": "писати деф в стан у разі зміни типу",
69
95
  "zh-cn": "在类型变化时将 def 写入状态"
70
- },
71
- "0.3.7": {
72
- "en": "improove forbidden chars and implements join raw",
73
- "de": "unproove verbotene wagen und geräte roh beitreten",
74
- "ru": "импровизировать запрещенные шары и реализаций присоединяются к сырому",
75
- "pt": "improove proibido chars e implementos se juntar cru",
76
- "nl": "improove verboden tekens en werktuigen samen rauw",
77
- "fr": "improove prohibed chars and implements joignent brut",
78
- "it": "improove vietati carboni e strumenti si uniscono crudo",
79
- "es": "improove chars prohibidos e implementos se unen a crudo",
80
- "pl": "improove zakazane znaki i narzędzia dołączyć surowe",
81
- "uk": "неприпустимий заборонений діаграма і реалізує приєднатися до сировини",
82
- "zh-cn": "将禁用字符和工具合并为原始字符"
83
- },
84
- "0.3.6": {
85
- "en": "set attributs if undefined",
86
- "de": "wenn nicht definiert",
87
- "ru": "набор атрибутов, если не определено",
88
- "pt": "definir atributos se indefinido",
89
- "nl": "attributes instellen indien niet gedefinieerd",
90
- "fr": "définir les attributs si non définis",
91
- "it": "attributi impostati se non definiti",
92
- "es": "conjunto atributos si no definido",
93
- "pl": "set attributs if undefined",
94
- "uk": "встановити attributs if undefined",
95
- "zh-cn": "如果未定义, 设置附件"
96
96
  }
97
97
  },
98
98
  "title": "LoRaWAN",
@@ -35,6 +35,12 @@ class directorieshandlerClass {
35
35
  // get roles
36
36
  this.uplinkRoles = this.getJsonFromDirectoryfile(`${this.adapter.adapterDir}${this.uplinkRolesPath}`);
37
37
 
38
+ //define path for devicetype difinitions
39
+ this.writeTriggerPath = "/lib/modules/roles/writeTrigger.json";
40
+
41
+ // get devicetype definitions
42
+ this.writeTrigger = this.getJsonFromDirectoryfile(`${this.adapter.adapterDir}${this.writeTriggerPath}`);
43
+
38
44
  // declare the directory structre
39
45
  this.directories = {
40
46
  application:{
@@ -255,9 +261,11 @@ class directorieshandlerClass {
255
261
  objectId = `${startDirectory}.${internalObjectId}`;
256
262
  }
257
263
  }
264
+ // Check for roles
258
265
  if(this.uplinkRoles[elementName]){
259
266
  stateCommonRole = this.uplinkRoles[elementName];
260
267
  }
268
+ // Check for id dont starts with "."
261
269
  if(objectId.indexOf(".") === 0){
262
270
  objectId.substring(1,objectId.length);
263
271
  }
@@ -278,7 +286,17 @@ class directorieshandlerClass {
278
286
  stateVal = JSON.stringify(stateVal);
279
287
  }
280
288
  if(stateVal !== undefined){
289
+ // Set State from Objectpath
281
290
  await this.adapter.setStateAsync(`${objectId}`,stateVal,true);
291
+ // Check, if there is some state to set in case of name and content
292
+ if(this.writeTrigger[elementName]){
293
+ const baseInfo = this.adapter.getBaseDeviceInfo(objectId);
294
+ const destinationId = `${baseInfo.objectStartDirectory}.${this.writeTrigger[elementName]}`;
295
+ const destinationState = await this.adapter.getStateAsync(destinationId);
296
+ if(destinationState?.val === ""){
297
+ await this.adapter.setStateAsync(destinationId,stateVal);
298
+ }
299
+ }
282
300
  }
283
301
  }
284
302
  }
@@ -0,0 +1,8 @@
1
+ {
2
+ "Devicetype": "configuration.devicetype",
3
+ "devicetype": "configuration.devicetype",
4
+ "Device": "configuration.devicetype",
5
+ "device": "configuration.devicetype",
6
+ "Hardware_mode": "configuration.devicetype",
7
+ "Hardware_Mode": "configuration.devicetype"
8
+ }
package/main.js CHANGED
@@ -322,7 +322,7 @@ class Lorawan extends utils.Adapter {
322
322
  try{
323
323
  this.log.silly(`changeinfo of id ${id}, will be generated.`);
324
324
  const changeInfo = this.getBaseDeviceInfo(id);
325
- const myId = `${changeInfo?.applicationId}.devices.${changeInfo?.deviceEUI}.${this.messagehandler?.directoryhandler.reachableSubfolders.configuration}.devicetype`;
325
+ const myId = `${changeInfo?.objectStartDirectory}.${this.messagehandler?.directoryhandler.reachableSubfolders.configuration}.devicetype`;
326
326
  // Check for changeInfo
327
327
  if(changeInfo){
328
328
  // Get Obect from startdirectory
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iobroker.lorawan",
3
- "version": "0.4.1",
3
+ "version": "0.5.1",
4
4
  "description": "converts the desired lora gateway data to a ioBroker structure",
5
5
  "author": {
6
6
  "name": "BenAhrdt",