Added new parameter and fixed ifdef

This commit is contained in:
CommanderRedYT
2021-12-08 22:50:30 +01:00
parent b899b0a503
commit cc0a23802f
2 changed files with 13 additions and 2 deletions

View File

@ -50,8 +50,15 @@ StringSettings makeDefaultStringSettings()
}, },
.otaServerUrl = {}, .otaServerUrl = {},
#endif #endif
#ifdef AP_PASSWORD
.ap_password = STRING(AP_PASSWORD), .ap_password = STRING(AP_PASSWORD),
.otaServerBranch = {} #else
.ap_password = "Bobbycar_123",
#endif
#ifdef FEATURE_OTA
.otaServerBranch = {},
#endif
.webserver_password = STRING(AP_PASSWORD),
}; };
} }
} // namespace presets } // namespace presets

View File

@ -49,7 +49,10 @@ struct StringSettings
std::string dns_key; std::string dns_key;
#endif #endif
std::string ap_password; std::string ap_password;
#ifdef FEATURE_OTA
std::string otaServerBranch; std::string otaServerBranch;
#endif
std::string webserver_password;
}; };
template<typename T> template<typename T>
@ -114,12 +117,13 @@ void StringSettings::executeForEveryCommonSetting(T &&callable)
// callable("otaUrl9", otaServers[9].url); // callable("otaUrl9", otaServers[9].url);
callable("otaserver", otaServerUrl); callable("otaserver", otaServerUrl);
callable("otaBranch", otaServerBranch);
#endif #endif
#ifdef FEATURE_DNS_NS #ifdef FEATURE_DNS_NS
callable("dnskey", dns_key); callable("dnskey", dns_key);
#endif #endif
callable("ap_pw", ap_password); callable("ap_pw", ap_password);
callable("otaBranch", otaServerBranch); callable("webpw", webserver_password);
} }
template<typename T> template<typename T>