Skip to content

Commit 9163f5e

Browse files
committed
Tentatively move OPEN state override to door_action check
1 parent ce7c061 commit 9163f5e

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

components/ratgdo/ratgdo.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -615,10 +615,15 @@ namespace ratgdo {
615615
this->door_action_delayed = DoorActionDelayed::NO;
616616
this->protocol_->door_action(DoorAction::CLOSE);
617617
});
618-
} else {
619-
this->protocol_->door_action(action);
618+
return;
620619
}
621620
#else
621+
if (action == DoorAction::STOP || action == DoorAction::TOGGLE) {
622+
// Door will likely be open partially unless closed
623+
if (*this->door_state == DoorState::OPENING || *this->door_state == DoorState::CLOSING) {
624+
this->received(DoorState::OPEN);
625+
}
626+
}
622627
this->protocol_->door_action(action);
623628
#endif
624629
}
@@ -654,8 +659,6 @@ namespace ratgdo {
654659
this->door_action(delta > 0 ? DoorAction::OPEN : DoorAction::CLOSE);
655660
set_timeout("move_to_position", operation_time, [this] {
656661
this->door_action(DoorAction::STOP);
657-
this->received(DoorState::OPEN);
658-
this->cancel_position_sync_callbacks();
659662
});
660663
}
661664

0 commit comments

Comments
 (0)