diff --git a/esphome/components/wifi/wifi_component.cpp b/esphome/components/wifi/wifi_component.cpp index 8e3fae99cd..9531c6dfc8 100644 --- a/esphome/components/wifi/wifi_component.cpp +++ b/esphome/components/wifi/wifi_component.cpp @@ -396,7 +396,7 @@ bool WiFiComponent::sync_selected_sta_to_best_scan_result_() { return false; } -WiFiAP WiFiComponent::get_sta() { +WiFiAP WiFiComponent::get_sta() const { const WiFiAP *config = this->get_selected_sta_(); return config ? *config : WiFiAP{}; } diff --git a/esphome/components/wifi/wifi_component.h b/esphome/components/wifi/wifi_component.h index 040dad3253..f5b50f29e9 100644 --- a/esphome/components/wifi/wifi_component.h +++ b/esphome/components/wifi/wifi_component.h @@ -218,8 +218,7 @@ class WiFiComponent : public Component { WiFiComponent(); void set_sta(const WiFiAP &ap); - // Returns a copy of the currently selected AP configuration - // Note: This copies the 88-byte WiFiAP. Only used by WiFiConfigureAction for state save/restore. + // Returns a copy of the currently selected AP configuration (88 bytes) WiFiAP get_sta() const; void init_sta(size_t count); void add_sta(const WiFiAP &ap);