time_based_cover.cpp with manual control fix (#6719)

This commit is contained in:
Jorge-Crespo-Celdran 2024-05-13 06:04:06 +02:00 committed by GitHub
parent dd81c83686
commit a23d1631e1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -96,6 +96,9 @@ void TimeBasedCover::control(const CoverCall &call) {
}
} else {
auto op = pos < this->position ? COVER_OPERATION_CLOSING : COVER_OPERATION_OPENING;
if (this->manual_control_ && (pos == COVER_OPEN || pos == COVER_CLOSED)) {
this->position = pos == COVER_CLOSED ? COVER_OPEN : COVER_CLOSED;
}
this->target_position_ = pos;
this->start_direction_(op);
}