Fix equality check when setting current-based cover position (#5167)

This commit is contained in:
Stefan Rado 2023-08-21 02:35:13 +02:00 committed by GitHub
parent 0443310385
commit 2a48b810a4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -38,7 +38,7 @@ void CurrentBasedCover::control(const CoverCall &call) {
}
if (call.get_position().has_value()) {
auto pos = *call.get_position();
if (pos == this->position) {
if (fabsf(this->position - pos) < 0.01) {
// already at target
} else {
auto op = pos < this->position ? COVER_OPERATION_CLOSING : COVER_OPERATION_OPENING;