mirror of
https://github.com/esphome/esphome.git
synced 2026-09-23 04:58:38 +00:00
reduce some code size
This commit is contained in:
@@ -1968,11 +1968,6 @@ void WiFiComponent::check_roaming_(uint32_t now) {
|
||||
if (!this->post_connect_roaming_)
|
||||
return;
|
||||
|
||||
// Guard: not for hidden networks (may not appear in scan)
|
||||
const WiFiAP *selected = this->get_selected_sta_();
|
||||
if (selected == nullptr || selected->get_hidden())
|
||||
return;
|
||||
|
||||
// Guard: attempt limit
|
||||
if (this->roaming_attempts_ >= ROAMING_MAX_ATTEMPTS)
|
||||
return;
|
||||
@@ -1990,6 +1985,11 @@ void WiFiComponent::check_roaming_(uint32_t now) {
|
||||
if (current_rssi == WIFI_RSSI_DISCONNECTED)
|
||||
return;
|
||||
|
||||
// Guard: not for hidden networks (may not appear in scan)
|
||||
const WiFiAP *selected = this->get_selected_sta_();
|
||||
if (selected == nullptr || selected->get_hidden())
|
||||
return;
|
||||
|
||||
this->roaming_last_check_ = now;
|
||||
ESP_LOGD(TAG, "Roaming: scanning for better AP (current RSSI %d dBm)", current_rssi);
|
||||
this->roaming_scan_active_ = true;
|
||||
|
||||
Reference in New Issue
Block a user