iobroker.lorawan 0.3.1 → 0.3.2
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 -14
- package/main.js +17 -17
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -22,6 +22,9 @@ 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.3.2 (2024-02-16)
|
|
26
|
+
* (BenAhrdt) wording recieved => received in messageing
|
|
27
|
+
|
|
25
28
|
### 0.3.1 (2024-02-15)
|
|
26
29
|
* (BenAhrdt) rebuild with better messageing
|
|
27
30
|
|
package/io-package.json
CHANGED
|
@@ -1,8 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"common": {
|
|
3
3
|
"name": "lorawan",
|
|
4
|
-
"version": "0.3.
|
|
4
|
+
"version": "0.3.2",
|
|
5
5
|
"news": {
|
|
6
|
+
"0.3.2": {
|
|
7
|
+
"en": "wording recieved => received in messageing",
|
|
8
|
+
"de": "zurückgegeben => in der mitteilung empfangen",
|
|
9
|
+
"ru": "=> в сообщении",
|
|
10
|
+
"pt": "redação recieved => recebido em mensagens",
|
|
11
|
+
"nl": "tekst ontvangen => ontvangen in berichtgeving",
|
|
12
|
+
"fr": "texte reçu => reçu en message",
|
|
13
|
+
"it": "> ricevuto nel messaggio",
|
|
14
|
+
"es": "wording recieved = recibidos en mensajes",
|
|
15
|
+
"pl": "sformułowanie otrzymane = > otrzymywane w procesie messaging",
|
|
16
|
+
"uk": "javascript licenses api веб-сайт go1.13.8 отримувати повідомлення",
|
|
17
|
+
"zh-cn": "重述的语句 发送信件时收到"
|
|
18
|
+
},
|
|
6
19
|
"0.3.1": {
|
|
7
20
|
"en": "rebuild with better messageing",
|
|
8
21
|
"de": "neuaufbau mit besserer botschaft",
|
|
@@ -80,19 +93,6 @@
|
|
|
80
93
|
"pl": "wartość domyślna błąd konfiguracyjny crc",
|
|
81
94
|
"uk": "за замовчуванням значення crc config fix",
|
|
82
95
|
"zh-cn": "默认值 crc 配置错误已修正"
|
|
83
|
-
},
|
|
84
|
-
"0.1.11": {
|
|
85
|
-
"en": "min / max values for downlink-configs (number)",
|
|
86
|
-
"de": "min / max werte für downlink-konfigs (anzahl)",
|
|
87
|
-
"ru": "min / max значения для конфигураций нисходящей ссылки (число)",
|
|
88
|
-
"pt": "min / valores máximos para downlink-configs (número)",
|
|
89
|
-
"nl": "min / max waarden voor downlink-configs (aantal)",
|
|
90
|
-
"fr": "valeurs min / max pour les configurations de liaison descendante (nombre)",
|
|
91
|
-
"it": "min / max valori per downlink-configs (numero)",
|
|
92
|
-
"es": "valores min / máx para los inconvenientes (número)",
|
|
93
|
-
"pl": "min / max wartości dla downlink- configs (liczba)",
|
|
94
|
-
"uk": "min / максимальні значення для налаштувань посилань (номер)",
|
|
95
|
-
"zh-cn": "下行链路配置最小值( 数)"
|
|
96
96
|
}
|
|
97
97
|
},
|
|
98
98
|
"title": "LoRaWAN",
|
package/main.js
CHANGED
|
@@ -399,7 +399,7 @@ class Lorawan extends utils.Adapter {
|
|
|
399
399
|
|
|
400
400
|
async onMessage(obj){
|
|
401
401
|
const activeFunction = "onMessage";
|
|
402
|
-
this.log.debug(`message
|
|
402
|
+
this.log.debug(`message received: command = ${obj.command} - message = ${JSON.stringify(obj.message)}`);
|
|
403
403
|
try{
|
|
404
404
|
if (typeof obj === "object" && obj.message){
|
|
405
405
|
let result = {};
|
|
@@ -407,14 +407,14 @@ class Lorawan extends utils.Adapter {
|
|
|
407
407
|
if(obj.message.deviceEUI){
|
|
408
408
|
const changeInfo = await this.getChangeInfoFromDeviceEUI(obj.message.deviceEUI,`${this.messagehandler?.directoryhandler.reachableSubfolders.configuration}.devicetype`);
|
|
409
409
|
if(changeInfo){
|
|
410
|
-
result = {applicationId: changeInfo.applicationId, deviceEUI: changeInfo.deviceEUI, deviceId: changeInfo.deviceId, deviceType: changeInfo.deviceType,
|
|
410
|
+
result = {applicationId: changeInfo.applicationId, deviceEUI: changeInfo.deviceEUI, deviceId: changeInfo.deviceId, deviceType: changeInfo.deviceType, received:obj.message};
|
|
411
411
|
}
|
|
412
412
|
else{
|
|
413
|
-
result = {error:true, message:"No device found",
|
|
413
|
+
result = {error:true, message:"No device found", received:obj.message};
|
|
414
414
|
}
|
|
415
415
|
}
|
|
416
416
|
else{
|
|
417
|
-
result = {error:true, message:"No deviceEUI found",
|
|
417
|
+
result = {error:true, message:"No deviceEUI found", received:obj.message};
|
|
418
418
|
}
|
|
419
419
|
// Send response
|
|
420
420
|
if (obj.callback) this.sendTo(obj.from, obj.command, result, obj.callback);
|
|
@@ -428,19 +428,19 @@ class Lorawan extends utils.Adapter {
|
|
|
428
428
|
if(await this.objectExists(uplinkId)){
|
|
429
429
|
const stateResult = await this.getStateAsync(changeInfo.id);
|
|
430
430
|
if(stateResult){
|
|
431
|
-
result = {applicationId: changeInfo.applicationId, deviceEUI: changeInfo.deviceEUI, deviceId: changeInfo.deviceId, deviceType: changeInfo.deviceType, value: stateResult.val,
|
|
431
|
+
result = {applicationId: changeInfo.applicationId, deviceEUI: changeInfo.deviceEUI, deviceId: changeInfo.deviceId, deviceType: changeInfo.deviceType, value: stateResult.val, received:obj.message};
|
|
432
432
|
}
|
|
433
433
|
}
|
|
434
434
|
else{
|
|
435
|
-
result = {error:true, message:"No uplink matches",
|
|
435
|
+
result = {error:true, message:"No uplink matches", received:obj.message};
|
|
436
436
|
}
|
|
437
437
|
}
|
|
438
438
|
else{
|
|
439
|
-
result = {error:true, message:"No device found",
|
|
439
|
+
result = {error:true, message:"No device found", received:obj.message};
|
|
440
440
|
}
|
|
441
441
|
}
|
|
442
442
|
else{
|
|
443
|
-
result = {error:true, message:"No deviceEUI & uplink found",
|
|
443
|
+
result = {error:true, message:"No deviceEUI & uplink found", received:obj.message};
|
|
444
444
|
}
|
|
445
445
|
// Send response
|
|
446
446
|
if (obj.callback) this.sendTo(obj.from, obj.command, result, obj.callback);
|
|
@@ -460,45 +460,45 @@ class Lorawan extends utils.Adapter {
|
|
|
460
460
|
// Check limit
|
|
461
461
|
if((!downlinkObject.common.min || obj.message.value >= downlinkObject.common.min) && (!downlinkObject.common.max || obj.message.value <= downlinkObject.common.max)){
|
|
462
462
|
await this.setStateAsync(downlinkId,obj.message.value);
|
|
463
|
-
result = {applicationId: changeInfo.applicationId, deviceEUI: changeInfo.deviceEUI, deviceId: changeInfo.deviceId, deviceType: changeInfo.deviceType, downlink: obj.message.downlink, value: obj.message.value,
|
|
463
|
+
result = {applicationId: changeInfo.applicationId, deviceEUI: changeInfo.deviceEUI, deviceId: changeInfo.deviceId, deviceType: changeInfo.deviceType, downlink: obj.message.downlink, value: obj.message.value, received:obj.message};
|
|
464
464
|
}
|
|
465
465
|
else{
|
|
466
|
-
result = {error:true, message:"value is not in valid range",
|
|
466
|
+
result = {error:true, message:"value is not in valid range", received:obj.message};
|
|
467
467
|
}
|
|
468
468
|
}
|
|
469
469
|
else{
|
|
470
|
-
result = {error:true, message: `downlink is type number, but
|
|
470
|
+
result = {error:true, message: `downlink is type number, but received ${typeof obj.message.value}`, received:obj.message};
|
|
471
471
|
}
|
|
472
472
|
}
|
|
473
473
|
// downlinkobject is not a number
|
|
474
474
|
else{
|
|
475
475
|
if(downlinkObject.common.type !== typeof obj.message.value){
|
|
476
|
-
result = {error:true, message: `downlink is type ${downlinkObject.common.type}, but
|
|
476
|
+
result = {error:true, message: `downlink is type ${downlinkObject.common.type}, but received ${typeof obj.message.value}`, received:obj.message};
|
|
477
477
|
}
|
|
478
478
|
else{
|
|
479
479
|
await this.setStateAsync(downlinkId,obj.message.value);
|
|
480
|
-
result = {applicationId: changeInfo.applicationId, deviceEUI: changeInfo.deviceEUI, deviceId: changeInfo.deviceId, deviceType: changeInfo.deviceType, downlink: obj.message.downlink, value: obj.message.value,
|
|
480
|
+
result = {applicationId: changeInfo.applicationId, deviceEUI: changeInfo.deviceEUI, deviceId: changeInfo.deviceId, deviceType: changeInfo.deviceType, downlink: obj.message.downlink, value: obj.message.value, received:obj.message};
|
|
481
481
|
}
|
|
482
482
|
}
|
|
483
483
|
}
|
|
484
484
|
}
|
|
485
485
|
else{
|
|
486
|
-
result = {error:true, message:"No downlink matches",
|
|
486
|
+
result = {error:true, message:"No downlink matches", received:obj.message};
|
|
487
487
|
}
|
|
488
488
|
}
|
|
489
489
|
else{
|
|
490
|
-
result = {error:true, message:"No device found",
|
|
490
|
+
result = {error:true, message:"No device found", received:obj.message};
|
|
491
491
|
}
|
|
492
492
|
}
|
|
493
493
|
else{
|
|
494
|
-
result = {error:true, message:"No deviceEUI, downlink & value found",
|
|
494
|
+
result = {error:true, message:"No deviceEUI, downlink & value found", received:obj.message};
|
|
495
495
|
}
|
|
496
496
|
// Send response
|
|
497
497
|
if (obj.callback) this.sendTo(obj.from, obj.command, result, obj.callback);
|
|
498
498
|
}
|
|
499
499
|
else
|
|
500
500
|
{
|
|
501
|
-
const result = {error:true, message: "No message matched",
|
|
501
|
+
const result = {error:true, message: "No message matched", received:obj.message};
|
|
502
502
|
if (obj.callback) this.sendTo(obj.from, obj.command, result, obj.callback);
|
|
503
503
|
}
|
|
504
504
|
}
|