From 935e0a365feb178ef93176725cce0ce79516bbb4 Mon Sep 17 00:00:00 2001 From: Keith Burzinski Date: Tue, 3 Jun 2025 15:50:22 -0500 Subject: [PATCH] [sps30] Shorten log messages (#8971) --- esphome/components/sps30/sps30.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/esphome/components/sps30/sps30.cpp b/esphome/components/sps30/sps30.cpp index 5a0335998f..8559a0fdf7 100644 --- a/esphome/components/sps30/sps30.cpp +++ b/esphome/components/sps30/sps30.cpp @@ -113,18 +113,18 @@ void SPS30Component::dump_config() { void SPS30Component::update() { /// Check if warning flag active (sensor reconnected?) if (this->status_has_warning()) { - ESP_LOGD(TAG, "Trying to reconnect the sensor..."); + ESP_LOGD(TAG, "Trying to reconnect"); if (this->write_command(SPS30_CMD_SOFT_RESET)) { - ESP_LOGD(TAG, "Sensor has soft-reset successfully. Waiting for reconnection in 500ms..."); + ESP_LOGD(TAG, "Soft-reset successful. Waiting for reconnection in 500 ms"); this->set_timeout(500, [this]() { this->start_continuous_measurement_(); /// Sensor restarted and reading attempt made next cycle this->status_clear_warning(); this->skipped_data_read_cycles_ = 0; - ESP_LOGD(TAG, "Sensor reconnected successfully. Resuming continuous measurement!"); + ESP_LOGD(TAG, "Reconnect successful. Resuming continuous measurement"); }); } else { - ESP_LOGD(TAG, "Sensor soft-reset failed. Is the sensor offline?"); + ESP_LOGD(TAG, "Soft-reset failed"); } return; } @@ -136,19 +136,19 @@ void SPS30Component::update() { uint16_t raw_read_status; if (!this->read_data(&raw_read_status, 1) || raw_read_status == 0x00) { - ESP_LOGD(TAG, "Sensor measurement not ready yet."); + ESP_LOGD(TAG, "Not ready yet"); this->skipped_data_read_cycles_++; /// The following logic is required to address the cases when a sensor is quickly replaced before it's marked /// as failed so that new sensor is eventually forced to be reinitialized for continuous measurement. if (this->skipped_data_read_cycles_ > MAX_SKIPPED_DATA_CYCLES_BEFORE_ERROR) { - ESP_LOGD(TAG, "Sensor exceeded max allowed attempts. Sensor communication will be reinitialized."); + ESP_LOGD(TAG, "Exceeded max allowed attempts; communication will be reinitialized"); this->status_set_warning(); } return; } if (!this->write_command(SPS30_CMD_READ_MEASUREMENT)) { - ESP_LOGW(TAG, "Error reading measurement status!"); + ESP_LOGW(TAG, "Error reading status"); this->status_set_warning(); return; } @@ -156,7 +156,7 @@ void SPS30Component::update() { this->set_timeout(50, [this]() { uint16_t raw_data[20]; if (!this->read_data(raw_data, 20)) { - ESP_LOGW(TAG, "Error reading measurement data!"); + ESP_LOGW(TAG, "Error reading data"); this->status_set_warning(); return; }