From 089e21b15a63b4d5e7a8fc0834122e33fbd2f8b3 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Tue, 30 Dec 2025 10:37:03 -1000 Subject: [PATCH] tweaks --- esphome/components/api/custom_api_device.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/esphome/components/api/custom_api_device.h b/esphome/components/api/custom_api_device.h index 13bf8c2c17..76d90c6cd8 100644 --- a/esphome/components/api/custom_api_device.h +++ b/esphome/components/api/custom_api_device.h @@ -142,9 +142,10 @@ class CustomAPIDevice { /** Subscribe to the state (or attribute state) of an entity from Home Assistant (legacy std::string version). * - * @deprecated Use the StringRef overload for zero-allocation callbacks. + * @deprecated Use the StringRef overload for zero-allocation callbacks. Will be removed in 2027.1.0. */ template + ESPDEPRECATED("Use void callback(StringRef) instead. Will be removed in 2027.1.0.", "2026.1.0") void subscribe_homeassistant_state(void (T::*callback)(std::string), const std::string &entity_id, const std::string &attribute = "") { auto f = std::bind(callback, (T *) this, std::placeholders::_1); @@ -179,9 +180,10 @@ class CustomAPIDevice { /** Subscribe to the state (or attribute state) of an entity from Home Assistant (legacy std::string version). * - * @deprecated Use the StringRef overload for zero-allocation callbacks. + * @deprecated Use the StringRef overload for zero-allocation callbacks. Will be removed in 2027.1.0. */ template + ESPDEPRECATED("Use void callback(const std::string &, StringRef) instead. Will be removed in 2027.1.0.", "2026.1.0") void subscribe_homeassistant_state(void (T::*callback)(std::string, std::string), const std::string &entity_id, const std::string &attribute = "") { auto f = std::bind(callback, (T *) this, entity_id, std::placeholders::_1);