From 24fc86c2c4819fe5aebf2c9854ffedb6cd08d46c Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Wed, 7 Oct 2026 10:48:46 -1000 Subject: [PATCH] [core] Deprecate TemplatableValue::is_static_string and get_static_string (#20280) --- esphome/core/automation.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/esphome/core/automation.h b/esphome/core/automation.h index f5921168e0..d3f1fe59e5 100644 --- a/esphome/core/automation.h +++ b/esphome/core/automation.h @@ -405,10 +405,14 @@ template class TemplatableValue { /// Check if this holds a static string (const char* stored without allocation) /// The pointer is always directly readable (RAM or flash-mapped). /// Returns false for FLASH_STRING (PROGMEM on ESP8266, requires _P functions). + // Remove before 2027.4.0 + ESPDEPRECATED("Read the value with ref_or_copy_to() instead. Removed in 2027.4.0", "2026.10.0") bool is_static_string() const { return this->type_ == STATIC_STRING; } /// Get the static string pointer (only valid if is_static_string() returns true) /// The pointer is always directly readable — FLASH_STRING uses a separate type. + // Remove before 2027.4.0 + ESPDEPRECATED("Use ref_or_copy_to() instead. Removed in 2027.4.0", "2026.10.0") const char *get_static_string() const { return this->static_str_; } /// Check if the string value is empty without allocating.