Fix door close without obstruction sensor

With the old code, the door would not close the door when stopped, if you don't have the obstruction sensor connect (e.g door stopped)
This commit is contained in:
Beat 2024-12-11 17:07:55 -05:00 committed by GitHub
parent 2b46c587fc
commit 60881341d8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 7 additions and 3 deletions

View File

@ -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) {