mirror of
				https://github.com/esphome/esphome.git
				synced 2025-10-31 15:12:06 +00:00 
			
		
		
		
	[sps30] Shorten log messages (#8971)
This commit is contained in:
		| @@ -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; | ||||
|     } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user