From f8138eef7778ecfb5b7cc0e000e1484735ea2f3b Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Fri, 27 Mar 2026 15:48:07 -1000 Subject: [PATCH] [binary_sensor] Replace truncation guard with ESPHOME_DEBUG_ASSERT --- esphome/components/binary_sensor/filter.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/esphome/components/binary_sensor/filter.h b/esphome/components/binary_sensor/filter.h index 0c66047769..8d52e5b896 100644 --- a/esphome/components/binary_sensor/filter.h +++ b/esphome/components/binary_sensor/filter.h @@ -114,10 +114,9 @@ template class AutorepeatFilter : public AutorepeatFilterBase { explicit AutorepeatFilter(std::initializer_list timings) { size_t i = 0; for (const auto &t : timings) { - if (i >= N) - break; this->timings_storage_[i++] = t; } + ESPHOME_DEBUG_ASSERT(i == N); this->timings_ = this->timings_storage_.data(); this->timings_count_ = N; }