diff --git a/esphome/core/automation.h b/esphome/core/automation.h index a574872bb2..eb270bfee2 100644 --- a/esphome/core/automation.h +++ b/esphome/core/automation.h @@ -40,6 +40,7 @@ template struct gens<0, S...> { using type = seq; }; template class TemplatableFn { public: TemplatableFn() = default; + TemplatableFn(std::nullptr_t) = delete; // Exact return type match — direct function pointer storage template TemplatableFn(F f) requires std::convertible_to : f_(f) {} @@ -102,6 +103,7 @@ using TemplatableStorage = template class TemplatableValue { public: TemplatableValue() = default; + TemplatableValue(std::nullptr_t) = delete; // Accept raw constants template TemplatableValue(V value) requires(!std::invocable) : tag_(VALUE) {