Merge pull request #1 from marcusb/ld2450

Detect movement also in the negative direction
This commit is contained in:
Hareesh M U 2024-09-04 18:39:52 +05:30 committed by GitHub
commit b0469c139d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

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++;
} }