From 28a94a0499905ed8c3b928e72bf4298b47f1d50a Mon Sep 17 00:00:00 2001 From: Marius Muja Date: Wed, 17 Jan 2024 10:44:01 -0800 Subject: [PATCH] Don't use ensure_door_action on sec+1 --- components/ratgdo/ratgdo.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/components/ratgdo/ratgdo.cpp b/components/ratgdo/ratgdo.cpp index 35a2c10..a10f3a6 100644 --- a/components/ratgdo/ratgdo.cpp +++ b/components/ratgdo/ratgdo.cpp @@ -97,7 +97,7 @@ namespace ratgdo { { ESP_LOGD(TAG, "Door state=%s", DoorState_to_string(door_state)); - + auto prev_door_state = *this->door_state; ESP_LOGD(TAG, "Door state=%s", DoorState_to_string(door_state)); @@ -538,7 +538,12 @@ namespace ratgdo { this->door_action(delta > 0 ? DoorAction::OPEN : DoorAction::CLOSE); set_timeout("move_to_position", operation_time, [=] { +#ifdef PROTOCOL_SECPLUSV2 this->ensure_door_action(DoorAction::STOP); +#else +// STOP command is idempotent only on sec+2, don't use ensure_door_action otherwise + this->door_action(DoorAction::STOP); +#endif }); }