From fb54defedabf2d092fb81bb27cd4c0ef4b865257 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Fri, 16 Oct 2026 13:06:31 -1000 Subject: [PATCH] [ld2410] Warn when a threshold number matches no gate --- esphome/components/ld2410/ld2410.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/esphome/components/ld2410/ld2410.cpp b/esphome/components/ld2410/ld2410.cpp index 71a9c4b8761..0213bf8ea56 100644 --- a/esphome/components/ld2410/ld2410.cpp +++ b/esphome/components/ld2410/ld2410.cpp @@ -733,8 +733,10 @@ void LD2410Component::set_gate_threshold(number::Number *n) { while (gate < TOTAL_GATES && this->gate_move_threshold_numbers_[gate] != n && this->gate_still_threshold_numbers_[gate] != n) gate++; - if (gate == TOTAL_GATES) + if (gate == TOTAL_GATES) { + ESP_LOGW(TAG, "Threshold number is not a known gate"); return; + } number::Number *motionsens = this->gate_move_threshold_numbers_[gate]; number::Number *stillsens = this->gate_still_threshold_numbers_[gate];