From 4d2162507ad20d8b1b7ee503de8bc810448762bf Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Fri, 1 Aug 2025 17:05:12 +0200 Subject: [PATCH] Fix LoRaWan config max node index --- tasmota/berry/lorawan/decoders/LwDecode.be | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/tasmota/berry/lorawan/decoders/LwDecode.be b/tasmota/berry/lorawan/decoders/LwDecode.be index a460f169b..5153b79e2 100644 --- a/tasmota/berry/lorawan/decoders/LwDecode.be +++ b/tasmota/berry/lorawan/decoders/LwDecode.be @@ -186,6 +186,14 @@ class webPageLoRaWAN : Driver tasmota.cmd('LoRaWanNode'+inode+' '+cmdArg,true) end + var appKey, decoder, name, enabled + var hintAK='32 character Application Key' + var hintDecoder='Decoder file, ending in .be' + var hintAN='Device name for MQTT messages' + var arg='LoRaWanNode' + var enables=string.split(tasmota.cmd(arg,true).find(arg), ',') # [1,!2,!3,!4,5,6] + var maxnode=enables.size() + webserver.content_start("LoRaWAN") #- title of the web page -# webserver.content_send_style() #- send standard Tasmota styles -# webserver.content_send( @@ -207,31 +215,23 @@ class webPageLoRaWAN : Driver "}" "}" "e.classList.add('active');" - "for(i=1;i<=16;i++){" + "for(i=1;i<="+str(maxnode)+";i++){" "document.getElementById('nd'+i).style.display=(i==n)?'block':'none';" "}" "}" "window.onload = function(){selNode("+str(inode)+");};" "") - var arg, appKey, decoder, name, enables, enabled - var hintAK='32 character Application Key' - var hintDecoder='Decoder file, ending in .be' - var hintAN='Device name for MQTT messages' - webserver.content_send( f"
" " LoRaWan End Device " "
") #- Add space and indent to align form tabs -# - for node:1..16 + for node:1..maxnode webserver.content_send(f"") end webserver.content_send( f"




") #- Terminate indent and add space -# - - arg='LoRaWanNode' - enables=string.split(tasmota.cmd(arg,true).find(arg), ',') # [1,!2,!3,!4,5,6,7,8,9,10,11,12,13,14,15,16] - for node:1..16 + for node:1..maxnode enabled="" if enables[node-1][0] != '!' enabled=' checked'