feat(network): add WiFi power management config options

Add two new fields to NetworkConfig:
- wifi_on_external_power_only: automatically disable WiFi when running on battery
- wifi_power_loss_timeout_secs: delay before disabling WiFi after power loss

This enables automatic WiFi management based on power source, improving
battery life for portable use while maintaining full connectivity when docked.

Relates to: https://github.com/meshtastic/firmware/issues/9427

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: Aleksei Sviridkin <f@lex.la>
This commit is contained in:
Aleksei Sviridkin 2026-01-25 05:22:12 +03:00
parent 77c8329a59
commit 8ebab18ba6
No known key found for this signature in database
GPG key ID: 7988329FDF395282

View file

@ -578,6 +578,20 @@ message Config {
*/
bool ipv6_enabled = 11;
/*
* Only enable WiFi when connected to external power (USB).
* WiFi will be automatically disabled when running on battery
* after wifi_power_loss_timeout_secs delay.
*/
bool wifi_on_external_power_only = 12;
/*
* Delay in seconds before disabling WiFi after external power is lost.
* This allows for brief power interruptions without toggling WiFi.
* Default: 30 seconds. Set to 0 for immediate disable.
*/
uint32 wifi_power_loss_timeout_secs = 13;
/*
* Available flags auxiliary network protocols
*/