Skip to content

Commit 993a464

Browse files
SteveEasleypre-commit-ci[bot]
authored andcommitted
Fix secplus1 emulation noise issue (ratgdo#548)
* Fix secplus1 emulation noise issue * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Ensure bad packets cant corrupt state * Ensure bad packets cant corrupt state v2 --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent e5ec9a2 commit 993a464

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

components/ratgdo/secplus1.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ namespace ratgdo {
4949
{
5050
this->wall_panel_emulation_state_ = WallPanelEmulationState::WAITING;
5151
this->wall_panel_emulation_start_ = millis();
52+
this->wall_panel_starting_ = false;
5253
this->door_state = DoorState::UNKNOWN;
5354
this->light_state = LightState::UNKNOWN;
5455
this->scheduler_->cancel_timeout(this->ratgdo_, "wall_panel_emulation");
@@ -296,10 +297,11 @@ namespace ratgdo {
296297
void Secplus1::handle_command(const RxCommand& cmd)
297298
{
298299
if (cmd.req == CommandType::TOGGLE_DOOR_RELEASE || cmd.resp == 0x31) {
299-
ESP_LOGD(TAG, "wall panel is starting");
300-
this->wall_panel_starting_ = true;
300+
if (this->wall_panel_emulation_state_ == WallPanelEmulationState::WAITING) {
301+
ESP_LOGD(TAG, "wall panel is starting");
302+
this->wall_panel_starting_ = true;
303+
}
301304
} else if (cmd.req == CommandType::QUERY_DOOR_STATUS) {
302-
303305
DoorState door_state;
304306
auto val = cmd.resp & 0x7;
305307
// 000 0x0 stopped

0 commit comments

Comments
 (0)