Skip to content

Commit 72968a0

Browse files
committed
Add mode0 safeguard
1 parent 27c4feb commit 72968a0

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

raw/LoRaWan_Decoders/SN50v3L.be

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class LwDecoDrgSN50v3L
3636
end
3737

3838
## SENSOR DATA ##
39-
if 2 == FPort && Bytes.size() > 10 # Variable length, depending on mode, but always 11 bytes or more
39+
if 2 == FPort && Bytes.size() > 10 # Variable length, depending on mode, but always 11 bytes or more
4040
valid_values = true
4141
last_seen = tasmota.rtc('local')
4242

@@ -52,7 +52,7 @@ class LwDecoDrgSN50v3L
5252
battery_last_seen = tasmota.rtc('local')
5353

5454
### TBA - handle all of the many cases
55-
if 0 == mode # Mode 1 (default)
55+
if 0 == mode # Mode 1 (default)
5656
var temp_pc13 = 1000
5757
var adc_pa4 = -1
5858
var digital_status
@@ -121,7 +121,7 @@ class LwDecoDrgSN50v3L
121121
end
122122
# sensor[0] [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17]
123123
global.DrgSN50v3LNodes.insert(Node, [Name, Node, last_seen, battery_last_seen, battery, RSSI, WorkingMode, mode, temp_pc13, adc_pa4, digital_status, digital_in_pb15, pb15_last_seen, digital_int_pa8, pa8_last_seen, illum_bh1750, temp_sht, humidity_sht])
124-
valid_values = false
124+
valid_values = false # Already updated
125125

126126
end # mode 0
127127

@@ -146,6 +146,7 @@ class LwDecoDrgSN50v3L
146146
if global.DrgSN50v3LNodes.find(Node)
147147
global.DrgSN50v3LNodes.remove(Node)
148148
end
149+
mode = -1 # Report incomplete list
149150
# sensor[0] [1] [2] [3] [4] [5] [6] [7]
150151
global.DrgSN50v3LNodes.insert(Node, [Name, Node, last_seen, battery_last_seen, battery, RSSI, WorkingMode, mode])
151152
end
@@ -158,7 +159,7 @@ class LwDecoDrgSN50v3L
158159
var msg = ""
159160
for sensor: global.DrgSN50v3LNodes
160161
var name = sensor[0]
161-
if string.find(name, "SN50v3-L") > -1 # If LoRaWanName contains SN50v3 use SN50v3-<node>
162+
if string.find(name, "SN50v3-L") > -1 # If LoRaWanName contains SN50v3 use SN50v3-<node>
162163
name = string.format("SN50v3-L-%i", sensor[1])
163164
end
164165
var name_tooltip = "Dragino SN50v3-L"

raw/LoRaWan_Decoders/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "LoRaWan Decoders",
3-
"version": "0x1A040A00",
3+
"version": "0x1A040B00",
44
"description": "Decode LoRaWan devices",
55
"author": "Theo Arends",
66
"min_tasmota": "0x0E060001",

0 commit comments

Comments
 (0)