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