From 2b60b0f1fa7ef0649f81c0f6da56b4ff04152a93 Mon Sep 17 00:00:00 2001 From: Guillermo Ruffino Date: Sat, 6 Mar 2021 19:59:06 -0300 Subject: [PATCH] fix servo warning (#1591) --- esphome/components/servo/servo.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esphome/components/servo/servo.cpp b/esphome/components/servo/servo.cpp index 5d2a9ee236..6935c34653 100644 --- a/esphome/components/servo/servo.cpp +++ b/esphome/components/servo/servo.cpp @@ -31,7 +31,7 @@ void Servo::loop() { if (this->transition_length_) { float new_value; float travel_diff = this->target_value_ - this->source_value_; - uint32_t target_runtime = target_runtime = abs((int) ((travel_diff) * this->transition_length_ * 1.0f / 2.0f)); + uint32_t target_runtime = abs((int) ((travel_diff) * this->transition_length_ * 1.0f / 2.0f)); uint32_t current_runtime = millis() - this->start_millis_; float percentage_run = current_runtime * 1.0f / target_runtime * 1.0f; if (percentage_run > 1.0f) {