diff --git a/esphome/components/binary_sensor/automation.h b/esphome/components/binary_sensor/automation.h index c52a27fa73..aa3d5d7fa4 100644 --- a/esphome/components/binary_sensor/automation.h +++ b/esphome/components/binary_sensor/automation.h @@ -131,11 +131,11 @@ template class MultiClickTrigger : public MultiClickTriggerBase { public: MultiClickTrigger(BinarySensor *parent, std::initializer_list timing) : MultiClickTriggerBase(parent) { + ESPHOME_DEBUG_ASSERT(timing.size() == N); size_t i = 0; for (const auto &t : timing) { this->timing_storage_[i++] = t; } - ESPHOME_DEBUG_ASSERT(i == N); this->timing_ = this->timing_storage_.data(); this->timing_count_ = N; }