From 3f2b0c3745fe28e38fcc6757e6e3cf6c26b6a42c Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Wed, 13 Nov 2024 05:26:27 -0600 Subject: [PATCH] Only allow 30 seconds minimum for power.on_battery_shutdown_after_secs --- src/modules/AdminModule.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/modules/AdminModule.cpp b/src/modules/AdminModule.cpp index 2ed053baed..c81b6ede4a 100644 --- a/src/modules/AdminModule.cpp +++ b/src/modules/AdminModule.cpp @@ -526,6 +526,11 @@ void AdminModule::handleSetConfig(const meshtastic_Config &c) requiresReboot = false; } config.power = c.payload_variant.power; + if (c.payload_variant.power.on_battery_shutdown_after_secs > 0 && + c.payload_variant.power.on_battery_shutdown_after_secs < 30) { + LOG_WARN("Tried to set on_battery_shutdown_after_secs too low, set to min 30 seconds"); + config.power.on_battery_shutdown_after_secs = 30; + } break; case meshtastic_Config_network_tag: LOG_INFO("Set config: WiFi");