From 21d490cb77ebf5f52f084a43fa47119438101caa Mon Sep 17 00:00:00 2001 From: Beat <66485277+Beat-YT@users.noreply.github.com> Date: Wed, 11 Dec 2024 18:47:50 -0500 Subject: [PATCH] Update ratgdo.cpp --- components/ratgdo/ratgdo.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/components/ratgdo/ratgdo.cpp b/components/ratgdo/ratgdo.cpp index 7ecb03e..e7b74fd 100644 --- a/components/ratgdo/ratgdo.cpp +++ b/components/ratgdo/ratgdo.cpp @@ -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) {