mirror of
				https://github.com/esphome/esphome.git
				synced 2025-10-30 22:53:59 +00:00 
			
		
		
		
	Introduce "communication failed" log macro (#8939)
This commit is contained in:
		| @@ -55,7 +55,7 @@ void PM2005Component::setup() { | ||||
|   } | ||||
|  | ||||
|   if (this->read(this->data_buffer_, 12) != i2c::ERROR_OK) { | ||||
|     ESP_LOGE(TAG, "Communication failed"); | ||||
|     ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL); | ||||
|     this->mark_failed(); | ||||
|     return; | ||||
|   } | ||||
| @@ -108,7 +108,7 @@ void PM2005Component::dump_config() { | ||||
|  | ||||
|   LOG_I2C_DEVICE(this); | ||||
|   if (this->is_failed()) { | ||||
|     ESP_LOGE(TAG, "Communication with PM2%u05 failed", this->sensor_type_ == PM2105); | ||||
|     ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL); | ||||
|   } | ||||
|  | ||||
|   LOG_SENSOR("  ", "PM1.0", this->pm_1_0_sensor_); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user