From 00a389bbb23f77346b625415c45cc243080b3f88 Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Tue, 21 May 2024 16:18:46 +0200 Subject: [PATCH] Add default LoRaCommand disable reception (#17790) --- tasmota/tasmota_xdrv_driver/xdrv_73_0_lora_struct.ino | 3 ++- tasmota/tasmota_xdrv_driver/xdrv_73_9_lora.ino | 7 +++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/tasmota/tasmota_xdrv_driver/xdrv_73_0_lora_struct.ino b/tasmota/tasmota_xdrv_driver/xdrv_73_0_lora_struct.ino index e4a204e28..622e36dd1 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_73_0_lora_struct.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_73_0_lora_struct.ino @@ -97,7 +97,8 @@ enum TasLoraFlags { TAS_LORA_FLAG_BRIDGE_ENABLED, TAS_LORA_FLAG_JOIN_ENABLED, - TAS_LORA_FLAG_DECODE_ENABLED + TAS_LORA_FLAG_DECODE_ENABLED, + TAS_LORA_COMMAND_ENABLED }; enum TasLoraWanFlags { diff --git a/tasmota/tasmota_xdrv_driver/xdrv_73_9_lora.ino b/tasmota/tasmota_xdrv_driver/xdrv_73_9_lora.ino index c2f6d671f..909ecd0cf 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_73_9_lora.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_73_9_lora.ino @@ -206,8 +206,10 @@ void LoraInput(void) { char *topic_part = strtok_r(payload, " ", &command_part); if (topic_part && command_part) { if (!strcasecmp(topic_part, SettingsText(SET_MQTT_TOPIC))) { // Is it mine - ExecuteCommand(command_part, SRC_REMOTE); - return; + if (bitRead(Lora->settings.flags, TAS_LORA_COMMAND_ENABLED)) { + ExecuteCommand(command_part, SRC_REMOTE); + return; + } } else { *--command_part = ' '; // Restore strtok_r '/0' } @@ -318,6 +320,7 @@ void CmndLoraOption(void) { // LoraOption1 1 - Enable LoRaWanBridge // LoraOption2 1 - Enable LoRaWanBridge Join // LoraOption3 1 - Enable LoRaWanBridge decoding + // LoraOption4 1 - Enable LoRaCommand reception if ((XdrvMailbox.index > 0) && (XdrvMailbox.index <= 8)) { uint32_t pindex = XdrvMailbox.index -1; if (XdrvMailbox.payload >= 0) {