1
0
mirror of https://github.com/esphome/esphome.git synced 2025-11-16 06:45:48 +00:00

[wifi] Optimize WiFi network storage with FixedVector (#11458)

Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
This commit is contained in:
J. Nick Koston
2025-10-21 19:23:10 -10:00
committed by GitHub
parent 146b067d62
commit e1c851cab8
4 changed files with 34 additions and 14 deletions

View File

@@ -330,9 +330,11 @@ float WiFiComponent::get_loop_priority() const {
return 10.0f; // before other loop components
}
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::set_sta(const WiFiAP &ap) {
this->clear_sta();
this->init_sta(1);
this->add_sta(ap);
}
void WiFiComponent::clear_sta() { this->sta_.clear(); }