From 3120a0ba83a50cddd798ce1f8449b59f5f405615 Mon Sep 17 00:00:00 2001 From: anatoly-savchenkov <48646998+anatoly-savchenkov@users.noreply.github.com> Date: Wed, 31 Aug 2022 01:19:43 +0300 Subject: [PATCH] Captive portal show nearby WiFi with no ssid configured (#3748) --- esphome/components/wifi/wifi_component.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/esphome/components/wifi/wifi_component.cpp b/esphome/components/wifi/wifi_component.cpp index 10bf4a8f9c..37f5276c8f 100644 --- a/esphome/components/wifi/wifi_component.cpp +++ b/esphome/components/wifi/wifi_component.cpp @@ -73,8 +73,11 @@ void WiFiComponent::setup() { ESP_LOGV(TAG, "Setting Output Power Option failed!"); } #ifdef USE_CAPTIVE_PORTAL - if (captive_portal::global_captive_portal != nullptr) + if (captive_portal::global_captive_portal != nullptr) { + this->wifi_sta_pre_setup_(); + this->start_scanning(); captive_portal::global_captive_portal->start(); + } #endif } #ifdef USE_IMPROV