diff --git a/esphome/components/wifi/wifi_component.cpp b/esphome/components/wifi/wifi_component.cpp index 4a76603691..a47cba169a 100644 --- a/esphome/components/wifi/wifi_component.cpp +++ b/esphome/components/wifi/wifi_component.cpp @@ -343,10 +343,6 @@ void WiFiComponent::set_sta(const WiFiAP &ap) { this->add_sta(ap); this->selected_sta_index_ = 0; } -void WiFiComponent::clear_sta() { - this->sta_.clear(); - this->selected_sta_index_ = -1; -} WiFiAP WiFiComponent::build_wifi_ap_from_selected_() const { // PRECONDITION: selected_sta_index_ must be valid (ensured by all callers) diff --git a/esphome/components/wifi/wifi_component.h b/esphome/components/wifi/wifi_component.h index a457ae6bd9..394f00fd57 100644 --- a/esphome/components/wifi/wifi_component.h +++ b/esphome/components/wifi/wifi_component.h @@ -222,7 +222,10 @@ class WiFiComponent : public Component { WiFiAP get_sta() const; void init_sta(size_t count); void add_sta(const WiFiAP &ap); - void clear_sta(); + void clear_sta() { + this->sta_.clear(); + this->selected_sta_index_ = -1; + } #ifdef USE_WIFI_AP /** Setup an Access Point that should be created if no connection to a station can be made.