Add timeout for motion detection
This commit is contained in:
parent
0b7b8519ef
commit
4598647843
|
@ -240,6 +240,9 @@ namespace ratgdo {
|
||||||
}
|
}
|
||||||
} else if (cmd == Command::MOTION) {
|
} else if (cmd == Command::MOTION) {
|
||||||
this->motion_state = MotionState::DETECTED;
|
this->motion_state = MotionState::DETECTED;
|
||||||
|
this->set_timeout("clear_motion", 3000, [=] {
|
||||||
|
this->motion_state = MotionState::CLEAR;
|
||||||
|
});
|
||||||
if (*this->light_state == LightState::OFF) {
|
if (*this->light_state == LightState::OFF) {
|
||||||
this->send_command(Command::GET_STATUS);
|
this->send_command(Command::GET_STATUS);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue