From 1d0a87daa84aafa464c547aaace1665e94fc9b16 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Sun, 9 Aug 2026 14:20:31 -0500 Subject: [PATCH] Address review: an empty service table with nodes logs a warning A service-less device or a failed materialization both leave the nodes unable to resolve; the client no longer sits inert without a trace. --- esphome/components/ble_client/ble_client_gatt.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/esphome/components/ble_client/ble_client_gatt.cpp b/esphome/components/ble_client/ble_client_gatt.cpp index 2dbe713f0d..1874b17daa 100644 --- a/esphome/components/ble_client/ble_client_gatt.cpp +++ b/esphome/components/ble_client/ble_client_gatt.cpp @@ -159,6 +159,11 @@ void BLEClient::on_service_discovery_done(int error) { // Materialize only when a node will read it: a client with no nodes // would pay the build/free cycle on every (re)connect for nothing. auto table = this->backend_->get_service_table(); + if (table.service_count == 0) { + // A service-less device or a failed materialization: either way the + // nodes cannot resolve, so say so instead of sitting inert. + ESP_LOGW(TAG, "[%s] Service table is empty; nodes will not resolve", this->address_str_); + } for (auto *node : this->nodes_) { node->on_connected(table); if (this->state_ != State::CONNECTED) {