From 034b47c23a08f9980bdae07bcafbcf22fc43dc2e Mon Sep 17 00:00:00 2001 From: Mat931 <49403702+Mat931@users.noreply.github.com> Date: Thu, 26 Jan 2023 19:09:22 +0000 Subject: [PATCH] Fix "BLE server / advertising always on" (#4353) --- esphome/components/esp32_ble/ble.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/esphome/components/esp32_ble/ble.cpp b/esphome/components/esp32_ble/ble.cpp index 456332b748..160084b913 100644 --- a/esphome/components/esp32_ble/ble.cpp +++ b/esphome/components/esp32_ble/ble.cpp @@ -31,11 +31,13 @@ void ESP32BLE::setup() { return; } +#ifdef USE_ESP32_BLE_SERVER this->advertising_ = new BLEAdvertising(); // NOLINT(cppcoreguidelines-owning-memory) this->advertising_->set_scan_response(true); this->advertising_->set_min_preferred_interval(0x06); this->advertising_->start(); +#endif // USE_ESP32_BLE_SERVER ESP_LOGD(TAG, "BLE setup complete"); }