From 869bafe33839693863f1485c75357a60900ed760 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/automation.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/esphome/components/binary_sensor/automation.h b/esphome/components/binary_sensor/automation.h index bab6e8577e9..c52a27fa732 100644 --- a/esphome/components/binary_sensor/automation.h +++ b/esphome/components/binary_sensor/automation.h @@ -133,10 +133,9 @@ template class MultiClickTrigger : public MultiClickTriggerBase { : MultiClickTriggerBase(parent) { size_t i = 0; for (const auto &t : timing) { - if (i >= N) - break; this->timing_storage_[i++] = t; } + ESPHOME_DEBUG_ASSERT(i == N); this->timing_ = this->timing_storage_.data(); this->timing_count_ = N; }