From 8f6acbd42d704afa848fdf30b1705751e3e09f80 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Tue, 7 Apr 2026 14:04:00 -1000 Subject: [PATCH] [core] Add const to string specialization optional_value/value_or --- esphome/core/automation.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/esphome/core/automation.h b/esphome/core/automation.h index af730c3545..3b04373fc6 100644 --- a/esphome/core/automation.h +++ b/esphome/core/automation.h @@ -289,13 +289,13 @@ template class TemplatableValue { } } - optional optional_value(X... x) { + optional optional_value(X... x) const { if (!this->has_value()) return {}; return this->value(x...); } - std::string value_or(X... x, std::string default_value) { + std::string value_or(X... x, std::string default_value) const { if (!this->has_value()) return default_value; return this->value(x...);