From 9e2bebc3f01cd513b812d168181c5a42fb23c360 Mon Sep 17 00:00:00 2001 From: Marius Muja Date: Fri, 12 Jan 2024 09:08:34 -0800 Subject: [PATCH] Trigger motion for light on in sec+1.0 --- components/ratgdo/secplus1.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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); + } } }