diff --git a/esphome/components/pid/pid_climate.cpp b/esphome/components/pid/pid_climate.cpp index ba3b8ec98a..2094c0e942 100644 --- a/esphome/components/pid/pid_climate.cpp +++ b/esphome/components/pid/pid_climate.cpp @@ -1,5 +1,4 @@ #include "pid_climate.h" -#include "esphome/core/entity_base.h" #include "esphome/core/log.h" namespace esphome { @@ -163,16 +162,14 @@ void PIDClimate::start_autotune(std::unique_ptr &&autotune) { float min_value = this->supports_cool_() ? -1.0f : 0.0f; float max_value = this->supports_heat_() ? 1.0f : 0.0f; this->autotuner_->config(min_value, max_value); - char object_id_buf[OBJECT_ID_MAX_LEN]; - StringRef object_id = this->get_object_id_to(object_id_buf); - this->autotuner_->set_autotuner_id(object_id.str()); + this->autotuner_->set_autotuner_id(this->get_name()); ESP_LOGI(TAG, "%s: Autotune has started. This can take a long time depending on the " "responsiveness of your system. Your system " "output will be altered to deliberately oscillate above and below the setpoint multiple times. " "Until your sensor provides a reading, the autotuner may display \'nan\'", - object_id.c_str()); + this->get_name().c_str()); this->set_interval("autotune-progress", 10000, [this]() { if (this->autotuner_ != nullptr && !this->autotuner_->is_finished()) @@ -180,7 +177,8 @@ void PIDClimate::start_autotune(std::unique_ptr &&autotune) { }); if (mode != climate::CLIMATE_MODE_HEAT_COOL) { - ESP_LOGW(TAG, "%s: !!! For PID autotuner you need to set AUTO (also called heat/cool) mode!", object_id.c_str()); + ESP_LOGW(TAG, "%s: !!! For PID autotuner you need to set AUTO (also called heat/cool) mode!", + this->get_name().c_str()); } }