From e158205e4c9788ded316e8eb70b7fcf2b1e5a09c Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Wed, 12 Aug 2026 18:38:04 -0500 Subject: [PATCH] Surface the node-capacity guard in component status and log sync register failures --- esphome/components/ble_client/ble_client.cpp | 3 ++- esphome/components/ble_client/ble_client_gatt.cpp | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/esphome/components/ble_client/ble_client.cpp b/esphome/components/ble_client/ble_client.cpp index 0f5f363bb1..eda1c2e6e4 100644 --- a/esphome/components/ble_client/ble_client.cpp +++ b/esphome/components/ble_client/ble_client.cpp @@ -145,6 +145,7 @@ void BLEClient::register_gatt_node(BLEClientNode *node) { // push_back past capacity is a silent no-op; an undersized slot count // must be loud at boot, not an unresolvable node at runtime. ESP_LOGE(TAG, "[%s] Node capacity exceeded; node dropped", this->address_str()); + this->status_set_error(LOG_STR("node capacity exceeded")); return; } this->gatt_nodes_.push_back(node); @@ -324,7 +325,7 @@ int BLEClient::notify_characteristic(uint16_t handle, bool enable) { esp_err_t err = this->register_for_notify(handle); if (err == ESP_OK) this->pending_gatt_regs_[this->pending_gatt_reg_count_++] = handle; - return err; + return this->check_and_log_error_("register_for_notify", err); } return this->check_and_log_error_("esp_ble_gattc_unregister_for_notify", esp_ble_gattc_unregister_for_notify(this->gattc_if_, this->remote_bda_, handle)); diff --git a/esphome/components/ble_client/ble_client_gatt.cpp b/esphome/components/ble_client/ble_client_gatt.cpp index fc8ef7338a..e7eaf5b6df 100644 --- a/esphome/components/ble_client/ble_client_gatt.cpp +++ b/esphome/components/ble_client/ble_client_gatt.cpp @@ -15,6 +15,7 @@ void BLEClient::register_ble_node(BLEClientNode *node) { // push_back past capacity is a silent no-op; an undersized slot count // must be loud at boot, not an unresolvable node at runtime. ESP_LOGE(TAG, "[%s] Node capacity exceeded; node dropped", this->address_str_); + this->status_set_error(LOG_STR("node capacity exceeded")); return; } this->nodes_.push_back(node);