Update ratgdo.cpp

This commit is contained in:
Beat 2024-12-11 18:47:50 -05:00 committed by GitHub
parent 60881341d8
commit 21d490cb77
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 8 deletions

View File

@ -460,15 +460,11 @@ namespace ratgdo {
return;
}
if (this->obstruction_sensor_detected_) {
this->door_action(DoorAction::CLOSE);
if (!this->obstruction_sensor_detected_ && (*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 {
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);
}
this->door_action(DoorAction::CLOSE);
}
if (*this->closing_duration > 0) {