From 4eec3f50768c7abdc9f1fe522277e5c65eeaeb51 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Fri, 27 Mar 2026 16:27:44 -1000 Subject: [PATCH] Fix: inline ESPHOME_DEBUG_ASSERT to avoid include order issue --- esphome/core/helpers.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/esphome/core/helpers.h b/esphome/core/helpers.h index 51feaa57c5..6922cd9cc0 100644 --- a/esphome/core/helpers.h +++ b/esphome/core/helpers.h @@ -501,7 +501,9 @@ template::max()> /// falls back to element-wise copy for non-trivially copyable types (e.g. TemplatableValue). /// N is set by code generation; ESPHOME_DEBUG_ASSERT catches mismatches in debug/integration tests. template inline void init_array_from(std::array &dest, std::initializer_list src) { - ESPHOME_DEBUG_ASSERT(src.size() == N); +#ifdef ESPHOME_DEBUG + assert(src.size() == N); +#endif if constexpr (std::is_trivially_copyable_v) { __builtin_memcpy(dest.data(), src.begin(), N * sizeof(T)); } else {