Unify device controls and restore the WiFi console

This commit is contained in:
mikecarper committed 2026-09-08 18:36:23 -07:00
1 parent 3746f9d5f4
commit 4c8aad5b16
44 files changed
+3573 -2948

No files matched your search

+16
View File
@@ -637,6 +637,22 @@ bool CompanionMqttSetupPortal::loadStoredConfig(MQTTPrefs& prefs) {
return true;
}
bool CompanionMqttSetupPortal::loadEnabled() {
Preferences nvs;
if (!nvs.begin(NVS_NAMESPACE, false)) return true;
const bool enabled = !nvs.isKey("enabled") || nvs.getBool("enabled", true);
nvs.end();
return enabled;
}
bool CompanionMqttSetupPortal::saveEnabled(bool enabled) {
Preferences nvs;
if (!nvs.begin(NVS_NAMESPACE, false)) return false;
const bool saved = nvs.putBool("enabled", enabled) == sizeof(bool);
nvs.end();
return saved;
}
bool CompanionMqttSetupPortal::saveStoredConfig(const MQTTPrefs& prefs) {
Preferences nvs;
if (!nvs.begin(NVS_NAMESPACE, false)) return false;