From ffd545c2560a10983fa45307f439ac6698e25f8b Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Sun, 18 Oct 2026 07:33:42 -1000 Subject: [PATCH] Log mics_5524 and sen6x entity names with get_log_name() --- esphome/components/mics_5524/mics_5524.cpp | 2 +- esphome/components/sen6x/sen6x.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/esphome/components/mics_5524/mics_5524.cpp b/esphome/components/mics_5524/mics_5524.cpp index bc559209afe..39bfbe98308 100644 --- a/esphome/components/mics_5524/mics_5524.cpp +++ b/esphome/components/mics_5524/mics_5524.cpp @@ -35,7 +35,7 @@ void MiCS5524GasSensor::publish_ratio(float ratio, micsmath::ConversionModel mod micsmath::clamp_ppm(micsmath::ppm_from_power_law(this->p0_, this->p1_, ratio), this->min_ppm_, this->max_ppm_); } #endif - ESP_LOGD(TAG, "'%s': ratio=%.4f -> %.1f ppm", this->get_name().c_str(), ratio, ppm); + ESP_LOGD(TAG, "'%s': ratio=%.4f -> %.1f ppm", LOG_STR_ARG(this->get_log_name()), ratio, ppm); this->publish_state(ppm); } diff --git a/esphome/components/sen6x/sen6x.cpp b/esphome/components/sen6x/sen6x.cpp index 9f95ed192c0..557d5292719 100644 --- a/esphome/components/sen6x/sen6x.cpp +++ b/esphome/components/sen6x/sen6x.cpp @@ -190,7 +190,7 @@ void SEN6XComponent::setup() { if ((entry.status == Sen6xStatus::SEN6X_STATUS_GAS_ERROR && !has_voc_nox) || (entry.status == Sen6xStatus::SEN6X_STATUS_CO2_ERROR && !has_co2) || (entry.status == Sen6xStatus::SEN6X_STATUS_HCHO_ERROR && !has_hcho)) { - ESP_LOGE(TAG, "'%s' needs a variant with that feature", entry.sensor->get_name().c_str()); + ESP_LOGE(TAG, "'%s' needs a variant with that feature", LOG_STR_ARG(entry.sensor->get_log_name())); continue; } entry.bit = status_bit(entry.status, this->sen6x_type_); @@ -360,7 +360,7 @@ void SEN6XComponent::dump_config() { } if (this->ambient_pressure_source_ != nullptr) { ESP_LOGCONFIG(TAG, " Ambient pressure compensation source: %s", - this->ambient_pressure_source_->get_name().c_str()); + LOG_STR_ARG(this->ambient_pressure_source_->get_log_name())); } } LOG_SENSOR(" ", "PM 1.0", this->pm_1_0_sensor_);