1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-03 03:42:20 +01:00

Allow preserving WiFi credentials entered with captive_portal (#3813)

This commit is contained in:
Kuba Szczodrzyński
2022-10-13 21:58:42 +02:00
committed by GitHub
parent 3b21d1d81e
commit 4bf94e0757
2 changed files with 27 additions and 1 deletions

View File

@@ -38,7 +38,11 @@ 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
this->pref_ = global_preferences->make_preference<wifi::SavedWifiSettings>(hash, true);
SavedWifiSettings save{};