Update MQTT preferences to support configurable WiFi power save mode

- Added conditional compilation for WiFi power save settings in setMQTTPrefsDefaults.
- Updated platformio.ini files across multiple variants to define MQTT_WIFI_POWER_SAVE_DEFAULT and related configurations.
- Set default WiFi power save mode to 1 (none) when not explicitly defined, enhancing flexibility for different hardware setups.
This commit is contained in:
agessaman committed 2026-01-18 13:40:01 -08:00
1 parent 3eaca31f0f
commit 56f98997e6
7 files changed
+22 -6

No files matched your search

+4
View File
@@ -271,7 +271,11 @@ static void setMQTTPrefsDefaults(MQTTPrefs* prefs) {
prefs->mqtt_status_interval = 300000; // 5 minutes default
prefs->mqtt_analyzer_us_enabled = 1; // enabled by default
prefs->mqtt_analyzer_eu_enabled = 1; // enabled by default
#ifdef MQTT_WIFI_POWER_SAVE_DEFAULT
prefs->wifi_power_save = MQTT_WIFI_POWER_SAVE_DEFAULT; // 0=min, 1=none, 2=max
#else
prefs->wifi_power_save = 0; // Default to WIFI_PS_MIN_MODEM (0=min)
#endif
// String fields are already zero-initialized by memset
}