Skip to content
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions components/ratgdo/secplus1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ namespace ratgdo {
{
this->wall_panel_emulation_state_ = WallPanelEmulationState::WAITING;
this->wall_panel_emulation_start_ = millis();
this->flags_.wall_panel_starting = false;
this->door_state = DoorState::UNKNOWN;
this->light_state = LightState::UNKNOWN;
this->scheduler_->cancel_timeout(this->ratgdo_, "wall_panel_emulation");
Expand Down Expand Up @@ -312,10 +313,12 @@ namespace ratgdo {

void Secplus1::handle_command(const RxCommand& cmd)
{
if (cmd.req == CommandType::TOGGLE_DOOR_RELEASE || cmd.resp == 0x31) {
if (this->wall_panel_emulation_state_ == WallPanelEmulationState::WAITING && (cmd.req == CommandType::TOGGLE_DOOR_RELEASE || cmd.resp == 0x31)) {
ESP_LOGD(TAG, "wall panel is starting");
this->flags_.wall_panel_starting = true;
} else if (cmd.req == CommandType::QUERY_DOOR_STATUS) {
}

if (cmd.req == CommandType::QUERY_DOOR_STATUS) {

DoorState door_state;
auto val = cmd.resp & 0x7;
Expand Down