[binary_sensor] Replace truncation guard with ESPHOME_DEBUG_ASSERT

This commit is contained in:
J. Nick Koston
2026-03-27 15:48:07 -10:00
parent f1221602f4
commit 869bafe338
@@ -133,10 +133,9 @@ template<size_t N> 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;
}