From 79490cb6b0ee98ace14695faf18d811b9d7ed218 Mon Sep 17 00:00:00 2001 From: Marius Muja Date: Thu, 18 Jan 2024 10:48:01 -0800 Subject: [PATCH] Handle the case of openers that stop door instead of opening it when toggling door while closing. --- components/ratgdo/secplus1.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/components/ratgdo/secplus1.cpp b/components/ratgdo/secplus1.cpp index afdffb7..dc280a7 100644 --- a/components/ratgdo/secplus1.cpp +++ b/components/ratgdo/secplus1.cpp @@ -152,11 +152,16 @@ namespace secplus1 { if (this->door_state == DoorState::CLOSED || this->door_state == DoorState::CLOSING) { this->toggle_door(); } else if (this->door_state == DoorState::STOPPED) { - this->toggle_door(); // this starts closing door - // this changes direction of door + this->toggle_door(); // this starts closing door this->on_door_state_([=](DoorState s) { if (s==DoorState::CLOSING) { + // this changes direction of the door on some openers, on others it stops it this->toggle_door(); + this->on_door_state_([=](DoorState s) { + if (s==DoorState::STOPPED) { + this->toggle_door(); + } + }); } }); }