From c09136da509f439a98586386faebc7d7f42e96e0 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Sun, 5 Nov 2023 09:40:25 -0600 Subject: [PATCH] Fix door requiring two close commands to close (#88) --- components/ratgdo/ratgdo.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/components/ratgdo/ratgdo.cpp b/components/ratgdo/ratgdo.cpp index 9ff2bb3..105af15 100644 --- a/components/ratgdo/ratgdo.cpp +++ b/components/ratgdo/ratgdo.cpp @@ -540,12 +540,16 @@ namespace ratgdo { this->door_state_received.then([=](DoorState s) { if (s == DoorState::STOPPED) { this->door_command(data::DOOR_CLOSE); + } else { + ESP_LOGW(TAG, "Door did not stop, ignoring close command"); } }); return; } - this->door_command(data::DOOR_CLOSE); + // Sometimes the door doesn't always close when its fully open + // so we use ensure_door_command to make sure it closes + this->ensure_door_command(data::DOOR_CLOSE); } void RATGDOComponent::stop_door()