mirror of
https://github.com/esphome/esphome.git
synced 2024-11-10 01:07:45 +01:00
Fix equality check when setting current-based cover position (#5167)
This commit is contained in:
parent
0443310385
commit
2a48b810a4
1 changed files with 1 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue