diff --git a/components/ratgdo/secplus1.cpp b/components/ratgdo/secplus1.cpp index 0a3acb1..173901d 100644 --- a/components/ratgdo/secplus1.cpp +++ b/components/ratgdo/secplus1.cpp @@ -181,7 +181,7 @@ namespace secplus1 { rx_packet[byte_count++] = ser_byte; reading_msg = true; - if (ser_byte == 0x37) { + if (ser_byte == 0x37 || (ser_byte >= 0x30 && ser_byte <= 0x35)) { rx_packet[byte_count++] = 0; reading_msg = false; byte_count = 0; @@ -297,6 +297,12 @@ namespace secplus1 { if (cmd.value == 0x31) { this->wall_panel_starting_ = true; } + } else if (cmd.type == CommandType::TOGGLE_LIGHT_REQ) { + // motion was detected, or the light toggle button was pressed + // either way it's ok to trigger motion detection + if (this->light_state == LightState::OFF) { + this->ratgdo_->received(MotionState::DETECTED); + } } }