Detect movement also in the negative direction

Movement should be registered if speed is non-zero, in both
directions.
This commit is contained in:
Marcus Better 2024-09-04 08:57:45 -04:00
parent 76c9f5530e
commit d921db5998

View file

@ -336,7 +336,7 @@ void LD2450Component::handle_periodic_data_(uint8_t *buffer, int len) {
if (ss != nullptr) { if (ss != nullptr) {
val = this->decode_speed_(buffer[start], buffer[start + 1]); val = this->decode_speed_(buffer[start], buffer[start + 1]);
ts = val; ts = val;
if (val > 0) { if (val) {
is_moving = true; is_moving = true;
moving_target_count++; moving_target_count++;
} }