diff --git a/components/ratgdo/ratgdo.cpp b/components/ratgdo/ratgdo.cpp index 90cb713..7ecb03e 100644 --- a/components/ratgdo/ratgdo.cpp +++ b/components/ratgdo/ratgdo.cpp @@ -462,9 +462,13 @@ namespace ratgdo { if (this->obstruction_sensor_detected_) { this->door_action(DoorAction::CLOSE); - } else if (*this->door_state == DoorState::OPEN) { - ESP_LOGD(TAG, "No obstruction sensors detected. Close using TOGGLE."); - this->door_action(DoorAction::TOGGLE); + } else { + if (*this->door_state == DoorState::OPEN || *this->door_state == DoorState::STOPPED) { + ESP_LOGD(TAG, "No obstruction sensors detected. Close using TOGGLE."); + this->door_action(DoorAction::TOGGLE); + } else { + this->door_action(DoorAction::CLOSE); + } } if (*this->closing_duration > 0) {