From 0acdbfd0072f18995a6a1b5ea61e8f3bc0b8cb4c Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Tue, 31 Mar 2026 11:12:11 -1000 Subject: [PATCH] de-nest --- .../esp32_ble_tracker/esp32_ble_tracker.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/esphome/components/esp32_ble_tracker/esp32_ble_tracker.cpp b/esphome/components/esp32_ble_tracker/esp32_ble_tracker.cpp index d72419df8d6..f2d60be6413 100644 --- a/esphome/components/esp32_ble_tracker/esp32_ble_tracker.cpp +++ b/esphome/components/esp32_ble_tracker/esp32_ble_tracker.cpp @@ -95,13 +95,11 @@ void ESP32BLETracker::on_ota_global_state(ota::OTAState state, float progress, u client->disconnect(); } #endif - } else if (state == ota::OTA_ERROR || state == ota::OTA_ABORT) { - if (this->scan_continuous_before_ota_) { - this->scan_continuous_before_ota_ = false; - this->scan_continuous_ = true; - // Do not restart scanning immediately here; allow loop() to - // safely restart scanning once the scanner and all clients are idle. - } + } else if ((state == ota::OTA_ERROR || state == ota::OTA_ABORT) && this->scan_continuous_before_ota_) { + this->scan_continuous_before_ota_ = false; + this->scan_continuous_ = true; + // Do not restart scanning immediately here; allow loop() to + // safely restart scanning once the scanner and all clients are idle. } } #endif