From 9491f3d100c574b384c84d18aafe38d1eafac9b1 Mon Sep 17 00:00:00 2001 From: bJ3h2-4-8 Date: Mon, 24 Feb 2025 13:44:58 +0100 Subject: [PATCH] fixing successful retry behaviour --- esphome/components/pid/pid_autotuner.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/esphome/components/pid/pid_autotuner.cpp b/esphome/components/pid/pid_autotuner.cpp index 28d16e17ab..c6707e4cf0 100644 --- a/esphome/components/pid/pid_autotuner.cpp +++ b/esphome/components/pid/pid_autotuner.cpp @@ -113,13 +113,14 @@ PIDAutotuner::PIDAutotuneResult PIDAutotuner::update(float setpoint, float proce if (this->enough_data_phase_ == 0) { this->enough_data_phase_ = phase; - } else if (phase - this->enough_data_phase_ <= 6) { + } + // + if (phase - this->enough_data_phase_ <= 6) { // keep trying for at least 6 more phases return res; - } else { + } // proceed to calculating PID parameters // warning will be shown in "Checks" section - } } ESP_LOGI(TAG, "%s: PID Autotune finished!", this->id_.c_str());