1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-02 19:32:19 +01:00

Always save user wifi credentials if non in config (#4036)

This commit is contained in:
Jesse Hills
2022-11-16 15:46:33 +13:00
committed by GitHub
parent 392dc8b0db
commit 147b113b62
2 changed files with 3 additions and 28 deletions

View File

@@ -39,11 +39,8 @@ void WiFiComponent::setup() {
this->last_connected_ = millis();
this->wifi_pre_setup_();
#ifndef USE_CAPTIVE_PORTAL_KEEP_USER_CREDENTIALS
uint32_t hash = fnv1_hash(App.get_compilation_time());
#else
uint32_t hash = 88491487UL;
#endif
uint32_t hash = this->has_sta() ? fnv1_hash(App.get_compilation_time()) : 88491487UL;
this->pref_ = global_preferences->make_preference<wifi::SavedWifiSettings>(hash, true);
SavedWifiSettings save{};