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...);