From 0913772e26eb248d100cd7f6004e5f459ddea347 Mon Sep 17 00:00:00 2001 From: Rapsssito Date: Thu, 20 Jun 2024 22:21:57 +0200 Subject: [PATCH] Fix service setup --- esphome/components/esp32_ble_server/ble_server.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esphome/components/esp32_ble_server/ble_server.cpp b/esphome/components/esp32_ble_server/ble_server.cpp index 72edaf1026..fc8c9659ff 100644 --- a/esphome/components/esp32_ble_server/ble_server.cpp +++ b/esphome/components/esp32_ble_server/ble_server.cpp @@ -128,7 +128,7 @@ BLEService *BLEServer::create_service(ESPBTUUID uuid, bool advertise, uint16_t n } BLEService *service = new BLEService(uuid, num_handles, inst_id, advertise); // NOLINT(cppcoreguidelines-owning-memory) this->services_.emplace(BLEServer::get_service_key(uuid, inst_id), service); - if (this->is_running()) { + if (this->parent_->is_active() && this->registered_) { service->do_create(this); } return service;