From d921db5998998032784b524425ab4a7e190cd0d1 Mon Sep 17 00:00:00 2001 From: Marcus Better Date: Wed, 4 Sep 2024 08:57:45 -0400 Subject: [PATCH] Detect movement also in the negative direction Movement should be registered if speed is non-zero, in both directions. --- esphome/components/ld2450/ld2450.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esphome/components/ld2450/ld2450.cpp b/esphome/components/ld2450/ld2450.cpp index b3e6c2be6f..e852a5d6a3 100644 --- a/esphome/components/ld2450/ld2450.cpp +++ b/esphome/components/ld2450/ld2450.cpp @@ -336,7 +336,7 @@ void LD2450Component::handle_periodic_data_(uint8_t *buffer, int len) { if (ss != nullptr) { val = this->decode_speed_(buffer[start], buffer[start + 1]); ts = val; - if (val > 0) { + if (val) { is_moving = true; moving_target_count++; }