mirror of
https://github.com/esphome/esphome.git
synced 2024-12-03 12:14:13 +01:00
Detect movement also in the negative direction
Movement should be registered if speed is non-zero, in both directions.
This commit is contained in:
parent
76c9f5530e
commit
d921db5998
1 changed files with 1 additions and 1 deletions
|
@ -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++;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue