mirror of
https://github.com/esphome/esphome.git
synced 2026-08-22 22:26:21 +00:00
[esp32_ble_tracker] Don't log an error when a scan stop is already in flight (#18306)
This commit is contained in:
@@ -202,8 +202,9 @@ void ESP32BLETracker::ble_before_disabled_event_handler() { this->stop_scan_();
|
|||||||
|
|
||||||
void ESP32BLETracker::stop_scan_() {
|
void ESP32BLETracker::stop_scan_() {
|
||||||
if (this->scanner_state_ != ScannerState::RUNNING && this->scanner_state_ != ScannerState::FAILED) {
|
if (this->scanner_state_ != ScannerState::RUNNING && this->scanner_state_ != ScannerState::FAILED) {
|
||||||
// If scanner is already idle, there's nothing to stop - this is not an error
|
// IDLE means there is nothing to stop; STOPPING means a stop is already in
|
||||||
if (this->scanner_state_ != ScannerState::IDLE) {
|
// flight and will finish on its own. Neither is an error.
|
||||||
|
if (this->scanner_state_ != ScannerState::IDLE && this->scanner_state_ != ScannerState::STOPPING) {
|
||||||
ESP_LOGE(TAG, "Cannot stop scan: %s", this->scanner_state_to_string_(this->scanner_state_));
|
ESP_LOGE(TAG, "Cannot stop scan: %s", this->scanner_state_to_string_(this->scanner_state_));
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user