diff --git a/esphome/components/wifi/wifi_component.cpp b/esphome/components/wifi/wifi_component.cpp index abd95ef898..b8a31f97a3 100644 --- a/esphome/components/wifi/wifi_component.cpp +++ b/esphome/components/wifi/wifi_component.cpp @@ -1017,6 +1017,8 @@ void WiFiComponent::set_ap(const WiFiAP &ap) { } #endif // USE_WIFI_AP +void WiFiComponent::init_sta(size_t count) { this->sta_.init(count); } +void WiFiComponent::add_sta(const WiFiAP &ap) { this->sta_.push_back(ap); } void WiFiComponent::clear_sta() { // Clear roaming state - no more configured networks this->clear_roaming_state_(); diff --git a/esphome/components/wifi/wifi_component.h b/esphome/components/wifi/wifi_component.h index 1738348a3f..14c9f0ad42 100644 --- a/esphome/components/wifi/wifi_component.h +++ b/esphome/components/wifi/wifi_component.h @@ -442,8 +442,9 @@ class WiFiComponent final : public Component { void set_sta(const WiFiAP &ap); // Returns a copy of the currently selected AP configuration WiFiAP get_sta() const; - void init_sta(size_t count) { this->sta_.init(count); } - void add_sta(const WiFiAP &ap) { this->sta_.push_back(ap); } + // Kept out of line: inlining these into the generated setup() grows flash + void init_sta(size_t count); + void add_sta(const WiFiAP &ap); void clear_sta(); #ifdef USE_WIFI_AP