From 44f1ff10e66169d194f7323ae2e14c367263a920 Mon Sep 17 00:00:00 2001 From: Keith Burzinski Date: Thu, 29 May 2025 01:59:38 -0500 Subject: [PATCH] Introduce "communication failed" log macro (#8939) --- esphome/components/ads1115/ads1115.cpp | 4 +--- esphome/components/ags10/ags10.cpp | 2 +- esphome/components/aht10/aht10.cpp | 10 +++++----- esphome/components/aic3204/aic3204.cpp | 2 +- esphome/components/am2315c/am2315c.cpp | 2 +- esphome/components/am2320/am2320.cpp | 2 +- esphome/components/apds9306/apds9306.cpp | 2 +- esphome/components/apds9960/apds9960.cpp | 2 +- esphome/components/as5600/as5600.cpp | 2 +- esphome/components/as7341/as7341.cpp | 2 +- esphome/components/atm90e26/atm90e26.cpp | 2 +- esphome/components/atm90e32/atm90e32.cpp | 2 +- esphome/components/bh1750/bh1750.cpp | 2 +- esphome/components/bme280_base/bme280_base.cpp | 2 +- esphome/components/bme680/bme680.cpp | 4 ++-- esphome/components/bmi160/bmi160.cpp | 2 +- esphome/components/bmp280_base/bmp280_base.cpp | 2 +- esphome/components/bmp3xx_base/bmp3xx_base.cpp | 2 +- esphome/components/ccs811/ccs811.cpp | 2 +- esphome/components/ch422g/ch422g.cpp | 2 +- esphome/components/cm1106/cm1106.cpp | 4 ++-- esphome/components/cse7761/cse7761.cpp | 2 +- esphome/components/dht12/dht12.cpp | 2 +- esphome/components/dps310/dps310.cpp | 2 +- esphome/components/ds1307/ds1307.cpp | 2 +- esphome/components/ee895/ee895.cpp | 2 +- esphome/components/emc2101/emc2101.cpp | 12 ++++++------ esphome/components/ens160_base/ens160_base.cpp | 2 +- esphome/components/ens210/ens210.cpp | 2 +- esphome/components/ezo/ezo.cpp | 2 +- esphome/components/ezo_pmp/ezo_pmp.cpp | 2 +- esphome/components/gdk101/gdk101.cpp | 2 +- .../components/grove_gas_mc_v2/grove_gas_mc_v2.cpp | 8 ++++---- esphome/components/hdc1080/hdc1080.cpp | 2 +- esphome/components/hm3301/hm3301.cpp | 2 +- esphome/components/hmc5883l/hmc5883l.cpp | 2 +- .../components/honeywell_hih_i2c/honeywell_hih.cpp | 8 ++++---- .../components/honeywellabp2_i2c/honeywellabp2.cpp | 6 +++--- esphome/components/hte501/hte501.cpp | 2 +- esphome/components/htu21d/htu21d.cpp | 2 +- esphome/components/htu31d/htu31d.cpp | 2 +- esphome/components/hyt271/hyt271.cpp | 4 ++-- esphome/components/iaqcore/iaqcore.cpp | 4 ++-- esphome/components/ina219/ina219.cpp | 2 +- esphome/components/ina226/ina226.cpp | 2 +- esphome/components/ina2xx_base/ina2xx_base.cpp | 2 +- esphome/components/ina3221/ina3221.cpp | 2 +- esphome/components/kamstrup_kmp/kamstrup_kmp.cpp | 2 +- esphome/components/lcd_pcf8574/pcf8574_display.cpp | 2 +- esphome/components/ltr501/ltr501.cpp | 2 +- esphome/components/ltr_als_ps/ltr_als_ps.cpp | 2 +- esphome/components/max17043/max17043.cpp | 2 +- esphome/components/max44009/max44009.cpp | 2 +- esphome/components/mcp4725/mcp4725.cpp | 2 +- esphome/components/mcp4728/mcp4728.cpp | 2 +- esphome/components/mcp9808/mcp9808.cpp | 6 +++--- esphome/components/mlx90393/sensor_mlx90393.cpp | 2 +- esphome/components/mlx90614/mlx90614.cpp | 4 ++-- esphome/components/mmc5603/mmc5603.cpp | 2 +- esphome/components/mpl3115a2/mpl3115a2.cpp | 2 +- esphome/components/mpr121/mpr121.cpp | 2 +- esphome/components/mpu6050/mpu6050.cpp | 2 +- esphome/components/mpu6886/mpu6886.cpp | 2 +- esphome/components/ms5611/ms5611.cpp | 2 +- esphome/components/ms8607/ms8607.cpp | 2 +- esphome/components/msa3xx/msa3xx.cpp | 2 +- esphome/components/nau7802/nau7802.cpp | 2 +- esphome/components/npi19/npi19.cpp | 6 ++---- esphome/components/pca6416a/pca6416a.cpp | 2 +- esphome/components/pca9554/pca9554.cpp | 2 +- esphome/components/pcf85063/pcf85063.cpp | 2 +- esphome/components/pcf8563/pcf8563.cpp | 2 +- esphome/components/pcf8574/pcf8574.cpp | 2 +- esphome/components/pm2005/pm2005.cpp | 4 ++-- esphome/components/pmwcs3/pmwcs3.cpp | 2 +- esphome/components/qmc5883l/qmc5883l.cpp | 2 +- esphome/components/qmp6988/qmp6988.cpp | 2 +- esphome/components/qwiic_pir/qwiic_pir.cpp | 2 +- esphome/components/scd30/scd30.cpp | 6 +++--- esphome/components/scd4x/scd4x.cpp | 6 +++--- esphome/components/sen0321/sen0321.cpp | 2 +- esphome/components/sen21231/sen21231.cpp | 2 +- esphome/components/sen5x/sen5x.cpp | 6 +++--- esphome/components/sgp30/sgp30.cpp | 8 ++++---- esphome/components/sgp4x/sgp4x.cpp | 8 ++++---- esphome/components/sht4x/sht4x.cpp | 2 +- esphome/components/shtcx/shtcx.cpp | 2 +- esphome/components/sps30/sps30.cpp | 6 +++--- esphome/components/ssd1306_i2c/ssd1306_i2c.cpp | 2 +- esphome/components/ssd1327_i2c/ssd1327_i2c.cpp | 2 +- esphome/components/st7567_i2c/st7567_i2c.cpp | 2 +- esphome/components/sts3x/sts3x.cpp | 2 +- esphome/components/tca9555/tca9555.cpp | 2 +- esphome/components/tcs34725/tcs34725.cpp | 2 +- esphome/components/tee501/tee501.cpp | 2 +- esphome/components/tem3200/tem3200.cpp | 4 ++-- esphome/components/tmp102/tmp102.cpp | 2 +- esphome/components/tmp1075/tmp1075.cpp | 2 +- esphome/components/tmp117/tmp117.cpp | 2 +- esphome/components/tof10120/tof10120_sensor.cpp | 4 ++-- esphome/components/tsl2561/tsl2561.cpp | 2 +- esphome/components/tsl2591/tsl2591.cpp | 2 +- esphome/components/ttp229_lsf/ttp229_lsf.cpp | 2 +- esphome/components/veml3235/veml3235.cpp | 2 +- esphome/components/veml7700/veml7700.cpp | 2 +- esphome/components/xl9535/xl9535.cpp | 2 +- esphome/core/log.h | 2 ++ esphome/core/log_const_en.h | 11 +++++++++++ script/ci-custom.py | 1 + 109 files changed, 162 insertions(+), 152 deletions(-) create mode 100644 esphome/core/log_const_en.h diff --git a/esphome/components/ads1115/ads1115.cpp b/esphome/components/ads1115/ads1115.cpp index e501bf14c5..11a5663ed1 100644 --- a/esphome/components/ads1115/ads1115.cpp +++ b/esphome/components/ads1115/ads1115.cpp @@ -17,8 +17,6 @@ void ADS1115Component::setup() { return; } - ESP_LOGCONFIG(TAG, "Configuring ADS1115..."); - uint16_t config = 0; // Clear single-shot bit // 0b0xxxxxxxxxxxxxxx @@ -71,7 +69,7 @@ void ADS1115Component::dump_config() { ESP_LOGCONFIG(TAG, "ADS1115:"); LOG_I2C_DEVICE(this); if (this->is_failed()) { - ESP_LOGE(TAG, "Communication with ADS1115 failed!"); + ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL); } } float ADS1115Component::request_measurement(ADS1115Multiplexer multiplexer, ADS1115Gain gain, diff --git a/esphome/components/ags10/ags10.cpp b/esphome/components/ags10/ags10.cpp index 664c5e850b..16228708ed 100644 --- a/esphome/components/ags10/ags10.cpp +++ b/esphome/components/ags10/ags10.cpp @@ -65,7 +65,7 @@ void AGS10Component::dump_config() { case NONE: break; case COMMUNICATION_FAILED: - ESP_LOGE(TAG, "Communication with AGS10 failed!"); + ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL); break; case CRC_CHECK_FAILED: ESP_LOGE(TAG, "The crc check failed"); diff --git a/esphome/components/aht10/aht10.cpp b/esphome/components/aht10/aht10.cpp index 2f7181cfb3..de7fd04be9 100644 --- a/esphome/components/aht10/aht10.cpp +++ b/esphome/components/aht10/aht10.cpp @@ -55,7 +55,7 @@ void AHT10Component::setup() { break; } if (error_code != i2c::ERROR_OK) { - ESP_LOGE(TAG, "Communication failed"); + ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL); this->mark_failed(); return; } @@ -64,7 +64,7 @@ void AHT10Component::setup() { while (data & AHT10_STATUS_BUSY) { delay(AHT10_DEFAULT_DELAY); if (this->read(&data, 1) != i2c::ERROR_OK) { - ESP_LOGE(TAG, "Communication failed"); + ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL); this->mark_failed(); return; } @@ -117,7 +117,7 @@ void AHT10Component::read_data_() { } else { ESP_LOGD(TAG, "Invalid humidity, retrying..."); if (this->write(AHT10_MEASURE_CMD, sizeof(AHT10_MEASURE_CMD)) != i2c::ERROR_OK) { - this->status_set_warning("Communication failed"); + this->status_set_warning(ESP_LOG_MSG_COMM_FAIL); } this->restart_read_(); return; @@ -148,7 +148,7 @@ void AHT10Component::update() { return; this->start_time_ = millis(); if (this->write(AHT10_MEASURE_CMD, sizeof(AHT10_MEASURE_CMD)) != i2c::ERROR_OK) { - this->status_set_warning("Communication failed"); + this->status_set_warning(ESP_LOG_MSG_COMM_FAIL); return; } this->restart_read_(); @@ -160,7 +160,7 @@ void AHT10Component::dump_config() { ESP_LOGCONFIG(TAG, "AHT10:"); LOG_I2C_DEVICE(this); if (this->is_failed()) { - ESP_LOGE(TAG, "Communication failed"); + ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL); } LOG_SENSOR(" ", "Temperature", this->temperature_sensor_); LOG_SENSOR(" ", "Humidity", this->humidity_sensor_); diff --git a/esphome/components/aic3204/aic3204.cpp b/esphome/components/aic3204/aic3204.cpp index 50ec272f58..a004fb42ce 100644 --- a/esphome/components/aic3204/aic3204.cpp +++ b/esphome/components/aic3204/aic3204.cpp @@ -113,7 +113,7 @@ void AIC3204::dump_config() { LOG_I2C_DEVICE(this); if (this->is_failed()) { - ESP_LOGE(TAG, "Communication with AIC3204 failed"); + ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL); } } diff --git a/esphome/components/am2315c/am2315c.cpp b/esphome/components/am2315c/am2315c.cpp index 33814e8740..cea5263fd6 100644 --- a/esphome/components/am2315c/am2315c.cpp +++ b/esphome/components/am2315c/am2315c.cpp @@ -188,7 +188,7 @@ void AM2315C::dump_config() { ESP_LOGCONFIG(TAG, "AM2315C:"); LOG_I2C_DEVICE(this); if (this->is_failed()) { - ESP_LOGE(TAG, "Communication with AM2315C failed!"); + ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL); } LOG_SENSOR(" ", "Temperature", this->temperature_sensor_); LOG_SENSOR(" ", "Humidity", this->humidity_sensor_); diff --git a/esphome/components/am2320/am2320.cpp b/esphome/components/am2320/am2320.cpp index 48a534250e..6400ecef4b 100644 --- a/esphome/components/am2320/am2320.cpp +++ b/esphome/components/am2320/am2320.cpp @@ -47,7 +47,7 @@ void AM2320Component::dump_config() { ESP_LOGD(TAG, "AM2320:"); LOG_I2C_DEVICE(this); if (this->is_failed()) { - ESP_LOGE(TAG, "Communication with AM2320 failed!"); + ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL); } LOG_SENSOR(" ", "Temperature", this->temperature_sensor_); LOG_SENSOR(" ", "Humidity", this->humidity_sensor_); diff --git a/esphome/components/apds9306/apds9306.cpp b/esphome/components/apds9306/apds9306.cpp index 73a33ccf9d..b785f61c57 100644 --- a/esphome/components/apds9306/apds9306.cpp +++ b/esphome/components/apds9306/apds9306.cpp @@ -97,7 +97,7 @@ void APDS9306::dump_config() { if (this->is_failed()) { switch (this->error_code_) { case COMMUNICATION_FAILED: - ESP_LOGE(TAG, "Communication with APDS9306 failed!"); + ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL); break; case WRONG_ID: ESP_LOGE(TAG, "APDS9306 has invalid id!"); diff --git a/esphome/components/apds9960/apds9960.cpp b/esphome/components/apds9960/apds9960.cpp index 375c977f9d..4a6ce371e5 100644 --- a/esphome/components/apds9960/apds9960.cpp +++ b/esphome/components/apds9960/apds9960.cpp @@ -141,7 +141,7 @@ void APDS9960::dump_config() { if (this->is_failed()) { switch (this->error_code_) { case COMMUNICATION_FAILED: - ESP_LOGE(TAG, "Communication with APDS9960 failed!"); + ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL); break; case WRONG_ID: ESP_LOGE(TAG, "APDS9960 has invalid id!"); diff --git a/esphome/components/as5600/as5600.cpp b/esphome/components/as5600/as5600.cpp index c04478eec9..5cfc7e1b9e 100644 --- a/esphome/components/as5600/as5600.cpp +++ b/esphome/components/as5600/as5600.cpp @@ -91,7 +91,7 @@ void AS5600Component::dump_config() { LOG_I2C_DEVICE(this); if (this->is_failed()) { - ESP_LOGE(TAG, "Communication with AS5600 failed!"); + ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL); return; } diff --git a/esphome/components/as7341/as7341.cpp b/esphome/components/as7341/as7341.cpp index 7999287c57..b01bcf2eed 100644 --- a/esphome/components/as7341/as7341.cpp +++ b/esphome/components/as7341/as7341.cpp @@ -38,7 +38,7 @@ void AS7341Component::dump_config() { ESP_LOGCONFIG(TAG, "AS7341:"); LOG_I2C_DEVICE(this); if (this->is_failed()) { - ESP_LOGE(TAG, "Communication with AS7341 failed!"); + ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL); } LOG_UPDATE_INTERVAL(this); ESP_LOGCONFIG(TAG, " Gain: %u", get_gain()); diff --git a/esphome/components/atm90e26/atm90e26.cpp b/esphome/components/atm90e26/atm90e26.cpp index 179c9254e0..ce254f9532 100644 --- a/esphome/components/atm90e26/atm90e26.cpp +++ b/esphome/components/atm90e26/atm90e26.cpp @@ -135,7 +135,7 @@ void ATM90E26Component::dump_config() { ESP_LOGCONFIG("", "ATM90E26:"); LOG_PIN(" CS Pin: ", this->cs_); if (this->is_failed()) { - ESP_LOGE(TAG, "Communication with ATM90E26 failed!"); + ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL); } LOG_UPDATE_INTERVAL(this); LOG_SENSOR(" ", "Voltage A", this->voltage_sensor_); diff --git a/esphome/components/atm90e32/atm90e32.cpp b/esphome/components/atm90e32/atm90e32.cpp index 8730eec5aa..545997eb14 100644 --- a/esphome/components/atm90e32/atm90e32.cpp +++ b/esphome/components/atm90e32/atm90e32.cpp @@ -217,7 +217,7 @@ void ATM90E32Component::dump_config() { ESP_LOGCONFIG("", "ATM90E32:"); LOG_PIN(" CS Pin: ", this->cs_); if (this->is_failed()) { - ESP_LOGE(TAG, "Communication with ATM90E32 failed!"); + ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL); } LOG_UPDATE_INTERVAL(this); LOG_SENSOR(" ", "Voltage A", this->phase_[PHASEA].voltage_sensor_); diff --git a/esphome/components/bh1750/bh1750.cpp b/esphome/components/bh1750/bh1750.cpp index bac69a2808..4b51794907 100644 --- a/esphome/components/bh1750/bh1750.cpp +++ b/esphome/components/bh1750/bh1750.cpp @@ -118,7 +118,7 @@ void BH1750Sensor::dump_config() { LOG_SENSOR("", "BH1750", this); LOG_I2C_DEVICE(this); if (this->is_failed()) { - ESP_LOGE(TAG, "Communication with BH1750 failed!"); + ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL_FOR, this->get_name().c_str()); } LOG_UPDATE_INTERVAL(this); diff --git a/esphome/components/bme280_base/bme280_base.cpp b/esphome/components/bme280_base/bme280_base.cpp index 5c43b61d1f..c73b48589d 100644 --- a/esphome/components/bme280_base/bme280_base.cpp +++ b/esphome/components/bme280_base/bme280_base.cpp @@ -182,7 +182,7 @@ void BME280Component::dump_config() { ESP_LOGCONFIG(TAG, "BME280:"); switch (this->error_code_) { case COMMUNICATION_FAILED: - ESP_LOGE(TAG, "Communication with BME280 failed!"); + ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL); break; case WRONG_CHIP_ID: ESP_LOGE(TAG, "BME280 has wrong chip ID! Is it a BME280?"); diff --git a/esphome/components/bme680/bme680.cpp b/esphome/components/bme680/bme680.cpp index 8266768e3e..7e8f2f5a32 100644 --- a/esphome/components/bme680/bme680.cpp +++ b/esphome/components/bme680/bme680.cpp @@ -215,7 +215,7 @@ void BME680Component::dump_config() { ESP_LOGCONFIG(TAG, "BME680:"); LOG_I2C_DEVICE(this); if (this->is_failed()) { - ESP_LOGE(TAG, "Communication with BME680 failed!"); + ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL); } ESP_LOGCONFIG(TAG, " IIR Filter: %s", iir_filter_to_str(this->iir_filter_)); LOG_UPDATE_INTERVAL(this); @@ -307,7 +307,7 @@ void BME680Component::read_data_() { this->humidity_sensor_->publish_state(NAN); if (this->gas_resistance_sensor_ != nullptr) this->gas_resistance_sensor_->publish_state(NAN); - ESP_LOGW(TAG, "Communication with BME680 failed!"); + ESP_LOGW(TAG, ESP_LOG_MSG_COMM_FAIL); this->status_set_warning(); return; } diff --git a/esphome/components/bmi160/bmi160.cpp b/esphome/components/bmi160/bmi160.cpp index fa246b821e..67106cc20c 100644 --- a/esphome/components/bmi160/bmi160.cpp +++ b/esphome/components/bmi160/bmi160.cpp @@ -189,7 +189,7 @@ void BMI160Component::dump_config() { ESP_LOGCONFIG(TAG, "BMI160:"); LOG_I2C_DEVICE(this); if (this->is_failed()) { - ESP_LOGE(TAG, "Communication with BMI160 failed!"); + ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL); } LOG_UPDATE_INTERVAL(this); LOG_SENSOR(" ", "Acceleration X", this->accel_x_sensor_); diff --git a/esphome/components/bmp280_base/bmp280_base.cpp b/esphome/components/bmp280_base/bmp280_base.cpp index 6ccade6e6b..665707e26c 100644 --- a/esphome/components/bmp280_base/bmp280_base.cpp +++ b/esphome/components/bmp280_base/bmp280_base.cpp @@ -132,7 +132,7 @@ void BMP280Component::dump_config() { ESP_LOGCONFIG(TAG, "BMP280:"); switch (this->error_code_) { case COMMUNICATION_FAILED: - ESP_LOGE(TAG, "Communication with BMP280 failed!"); + ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL); break; case WRONG_CHIP_ID: ESP_LOGE(TAG, "BMP280 has wrong chip ID! Is it a BME280?"); diff --git a/esphome/components/bmp3xx_base/bmp3xx_base.cpp b/esphome/components/bmp3xx_base/bmp3xx_base.cpp index af6e50eb51..d35c5fd331 100644 --- a/esphome/components/bmp3xx_base/bmp3xx_base.cpp +++ b/esphome/components/bmp3xx_base/bmp3xx_base.cpp @@ -154,7 +154,7 @@ void BMP3XXComponent::dump_config() { case NONE: break; case ERROR_COMMUNICATION_FAILED: - ESP_LOGE(TAG, "Communication with BMP3XX failed!"); + ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL); break; case ERROR_WRONG_CHIP_ID: ESP_LOGE( diff --git a/esphome/components/ccs811/ccs811.cpp b/esphome/components/ccs811/ccs811.cpp index f1dadf673a..700e1b4df0 100644 --- a/esphome/components/ccs811/ccs811.cpp +++ b/esphome/components/ccs811/ccs811.cpp @@ -163,7 +163,7 @@ void CCS811Component::dump_config() { if (this->is_failed()) { switch (this->error_code_) { case COMMUNICATION_FAILED: - ESP_LOGW(TAG, "Communication failed! Is the sensor connected?"); + ESP_LOGW(TAG, ESP_LOG_MSG_COMM_FAIL); break; case INVALID_ID: ESP_LOGW(TAG, "Sensor reported an invalid ID. Is this a CCS811?"); diff --git a/esphome/components/ch422g/ch422g.cpp b/esphome/components/ch422g/ch422g.cpp index 9c8a5013f7..325c56e470 100644 --- a/esphome/components/ch422g/ch422g.cpp +++ b/esphome/components/ch422g/ch422g.cpp @@ -37,7 +37,7 @@ void CH422GComponent::dump_config() { ESP_LOGCONFIG(TAG, "CH422G:"); LOG_I2C_DEVICE(this) if (this->is_failed()) { - ESP_LOGE(TAG, "Communication with CH422G failed!"); + ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL); } } diff --git a/esphome/components/cm1106/cm1106.cpp b/esphome/components/cm1106/cm1106.cpp index 1b2cdcc2e6..aa19c0664e 100644 --- a/esphome/components/cm1106/cm1106.cpp +++ b/esphome/components/cm1106/cm1106.cpp @@ -23,7 +23,7 @@ void CM1106Component::setup() { ESP_LOGCONFIG(TAG, "Running setup"); uint8_t response[8] = {0}; if (!this->cm1106_write_command_(C_M1106_CMD_GET_CO2, sizeof(C_M1106_CMD_GET_CO2), response, sizeof(response))) { - ESP_LOGE(TAG, "Communication with CM1106 failed!"); + ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL); this->mark_failed(); return; } @@ -104,7 +104,7 @@ void CM1106Component::dump_config() { LOG_SENSOR(" ", "CO2", this->co2_sensor_); this->check_uart_settings(9600); if (this->is_failed()) { - ESP_LOGE(TAG, "Communication with CM1106 failed!"); + ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL); } } diff --git a/esphome/components/cse7761/cse7761.cpp b/esphome/components/cse7761/cse7761.cpp index cca562400a..6c3d457f26 100644 --- a/esphome/components/cse7761/cse7761.cpp +++ b/esphome/components/cse7761/cse7761.cpp @@ -57,7 +57,7 @@ void CSE7761Component::setup() { void CSE7761Component::dump_config() { ESP_LOGCONFIG(TAG, "CSE7761:"); if (this->is_failed()) { - ESP_LOGE(TAG, "Communication with CSE7761 failed!"); + ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL); } LOG_UPDATE_INTERVAL(this); this->check_uart_settings(38400, 1, uart::UART_CONFIG_PARITY_EVEN, 8); diff --git a/esphome/components/dht12/dht12.cpp b/esphome/components/dht12/dht12.cpp index 764511e007..54a6688b0b 100644 --- a/esphome/components/dht12/dht12.cpp +++ b/esphome/components/dht12/dht12.cpp @@ -45,7 +45,7 @@ void DHT12Component::dump_config() { ESP_LOGD(TAG, "DHT12:"); LOG_I2C_DEVICE(this); if (this->is_failed()) { - ESP_LOGE(TAG, "Communication with DHT12 failed!"); + ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL); } LOG_SENSOR(" ", "Temperature", this->temperature_sensor_); LOG_SENSOR(" ", "Humidity", this->humidity_sensor_); diff --git a/esphome/components/dps310/dps310.cpp b/esphome/components/dps310/dps310.cpp index 4d5026708c..b1287b6f2d 100644 --- a/esphome/components/dps310/dps310.cpp +++ b/esphome/components/dps310/dps310.cpp @@ -91,7 +91,7 @@ void DPS310Component::dump_config() { ESP_LOGCONFIG(TAG, " Revision ID: %u", (this->prod_rev_id_ >> 4) & 0x0F); LOG_I2C_DEVICE(this); if (this->is_failed()) { - ESP_LOGE(TAG, "Communication with DPS310 failed!"); + ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL); } LOG_UPDATE_INTERVAL(this); LOG_SENSOR(" ", "Temperature", this->temperature_sensor_); diff --git a/esphome/components/ds1307/ds1307.cpp b/esphome/components/ds1307/ds1307.cpp index 21ac18512f..db0180e6f1 100644 --- a/esphome/components/ds1307/ds1307.cpp +++ b/esphome/components/ds1307/ds1307.cpp @@ -22,7 +22,7 @@ void DS1307Component::dump_config() { ESP_LOGCONFIG(TAG, "DS1307:"); LOG_I2C_DEVICE(this); if (this->is_failed()) { - ESP_LOGE(TAG, "Communication with DS1307 failed!"); + ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL); } ESP_LOGCONFIG(TAG, " Timezone: '%s'", this->timezone_.c_str()); } diff --git a/esphome/components/ee895/ee895.cpp b/esphome/components/ee895/ee895.cpp index 59362de1f7..4ce29bcfab 100644 --- a/esphome/components/ee895/ee895.cpp +++ b/esphome/components/ee895/ee895.cpp @@ -35,7 +35,7 @@ void EE895Component::dump_config() { LOG_I2C_DEVICE(this); switch (this->error_code_) { case COMMUNICATION_FAILED: - ESP_LOGE(TAG, "Communication with EE895 failed!"); + ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL); break; case CRC_CHECK_FAILED: ESP_LOGE(TAG, "The crc check failed"); diff --git a/esphome/components/emc2101/emc2101.cpp b/esphome/components/emc2101/emc2101.cpp index 85a572e51e..6918c6d391 100644 --- a/esphome/components/emc2101/emc2101.cpp +++ b/esphome/components/emc2101/emc2101.cpp @@ -94,7 +94,7 @@ void Emc2101Component::dump_config() { ESP_LOGCONFIG(TAG, "Emc2101 component:"); LOG_I2C_DEVICE(this); if (this->is_failed()) { - ESP_LOGE(TAG, "Communication with EMC2101 failed!"); + ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL); } ESP_LOGCONFIG(TAG, " Mode: %s", this->dac_mode_ ? "DAC" : "PWM"); if (this->dac_mode_) { @@ -110,7 +110,7 @@ void Emc2101Component::set_duty_cycle(float value) { uint8_t duty_cycle = remap(value, 0.0f, 1.0f, (uint8_t) 0, this->max_output_value_); ESP_LOGD(TAG, "Setting duty fan setting to %02X", duty_cycle); if (!this->write_byte(EMC2101_REGISTER_FAN_SETTING, duty_cycle)) { - ESP_LOGE(TAG, "Communication with EMC2101 failed!"); + ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL); this->status_set_warning(); return; } @@ -119,7 +119,7 @@ void Emc2101Component::set_duty_cycle(float value) { float Emc2101Component::get_duty_cycle() { uint8_t duty_cycle; if (!this->read_byte(EMC2101_REGISTER_FAN_SETTING, &duty_cycle)) { - ESP_LOGE(TAG, "Communication with EMC2101 failed!"); + ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL); this->status_set_warning(); return NAN; } @@ -129,7 +129,7 @@ float Emc2101Component::get_duty_cycle() { float Emc2101Component::get_internal_temperature() { uint8_t temperature; if (!this->read_byte(EMC2101_REGISTER_INTERNAL_TEMP, &temperature)) { - ESP_LOGE(TAG, "Communication with EMC2101 failed!"); + ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL); this->status_set_warning(); return NAN; } @@ -141,7 +141,7 @@ float Emc2101Component::get_external_temperature() { uint8_t lsb, msb; if (!this->read_byte(EMC2101_REGISTER_EXTERNAL_TEMP_MSB, &msb) || !this->read_byte(EMC2101_REGISTER_EXTERNAL_TEMP_LSB, &lsb)) { - ESP_LOGE(TAG, "Communication with EMC2101 failed!"); + ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL); this->status_set_warning(); return NAN; } @@ -155,7 +155,7 @@ float Emc2101Component::get_speed() { // Read **LSB** first to match 'Data Read Interlock' behavior from 6.1 of datasheet uint8_t lsb, msb; if (!this->read_byte(EMC2101_REGISTER_TACH_LSB, &lsb) || !this->read_byte(EMC2101_REGISTER_TACH_MSB, &msb)) { - ESP_LOGE(TAG, "Communication with EMC2101 failed!"); + ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL); this->status_set_warning(); return NAN; } diff --git a/esphome/components/ens160_base/ens160_base.cpp b/esphome/components/ens160_base/ens160_base.cpp index de2f45b5fa..7e5b8528b7 100644 --- a/esphome/components/ens160_base/ens160_base.cpp +++ b/esphome/components/ens160_base/ens160_base.cpp @@ -279,7 +279,7 @@ void ENS160Component::dump_config() { switch (this->error_code_) { case COMMUNICATION_FAILED: - ESP_LOGE(TAG, "Communication failed! Is the sensor connected?"); + ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL); break; case READ_FAILED: ESP_LOGE(TAG, "Error reading from register"); diff --git a/esphome/components/ens210/ens210.cpp b/esphome/components/ens210/ens210.cpp index a58bc8cd64..b296e9dd42 100644 --- a/esphome/components/ens210/ens210.cpp +++ b/esphome/components/ens210/ens210.cpp @@ -163,7 +163,7 @@ void ENS210Component::update() { // Read T_VAL and H_VAL if (!this->read_bytes(ENS210_REGISTER_T_VAL, data, 6)) { - ESP_LOGE(TAG, "Communication with ENS210 failed!"); + ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL); this->status_set_warning(); return; } diff --git a/esphome/components/ezo/ezo.cpp b/esphome/components/ezo/ezo.cpp index 10f3d530ce..2e92c58e29 100644 --- a/esphome/components/ezo/ezo.cpp +++ b/esphome/components/ezo/ezo.cpp @@ -15,7 +15,7 @@ void EZOSensor::dump_config() { LOG_SENSOR("", "EZO", this); LOG_I2C_DEVICE(this); if (this->is_failed()) { - ESP_LOGE(TAG, "Communication with EZO circuit failed!"); + ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL); } LOG_UPDATE_INTERVAL(this); } diff --git a/esphome/components/ezo_pmp/ezo_pmp.cpp b/esphome/components/ezo_pmp/ezo_pmp.cpp index 6e5779a12e..9ec41cce30 100644 --- a/esphome/components/ezo_pmp/ezo_pmp.cpp +++ b/esphome/components/ezo_pmp/ezo_pmp.cpp @@ -41,7 +41,7 @@ static const std::string DOSING_MODE_CONTINUOUS = "Continuous"; void EzoPMP::dump_config() { LOG_I2C_DEVICE(this); if (this->is_failed()) { - ESP_LOGE(TAG, "Communication with EZO-PMP circuit failed!"); + ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL); } LOG_UPDATE_INTERVAL(this); } diff --git a/esphome/components/gdk101/gdk101.cpp b/esphome/components/gdk101/gdk101.cpp index d58c987ed7..e8401aa09b 100644 --- a/esphome/components/gdk101/gdk101.cpp +++ b/esphome/components/gdk101/gdk101.cpp @@ -60,7 +60,7 @@ void GDK101Component::dump_config() { ESP_LOGCONFIG(TAG, "GDK101:"); LOG_I2C_DEVICE(this); if (this->is_failed()) { - ESP_LOGE(TAG, "Communication with GDK101 failed!"); + ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL); } #ifdef USE_SENSOR LOG_SENSOR(" ", "Firmware Version", this->fw_version_sensor_); diff --git a/esphome/components/grove_gas_mc_v2/grove_gas_mc_v2.cpp b/esphome/components/grove_gas_mc_v2/grove_gas_mc_v2.cpp index 9e82109ffc..361f3e04fd 100644 --- a/esphome/components/grove_gas_mc_v2/grove_gas_mc_v2.cpp +++ b/esphome/components/grove_gas_mc_v2/grove_gas_mc_v2.cpp @@ -67,17 +67,17 @@ void GroveGasMultichannelV2Component::dump_config() { if (this->is_failed()) { switch (this->error_code_) { case COMMUNICATION_FAILED: - ESP_LOGW(TAG, "Communication failed! Is the sensor connected?"); + ESP_LOGW(TAG, ESP_LOG_MSG_COMM_FAIL); break; case APP_INVALID: - ESP_LOGW(TAG, "Sensor reported invalid APP installed."); + ESP_LOGW(TAG, "Sensor reported invalid APP installed"); break; case APP_START_FAILED: - ESP_LOGW(TAG, "Sensor reported APP start failed."); + ESP_LOGW(TAG, "Sensor reported APP start failed"); break; case UNKNOWN: default: - ESP_LOGW(TAG, "Unknown setup error!"); + ESP_LOGW(TAG, "Unknown setup error"); break; } } diff --git a/esphome/components/hdc1080/hdc1080.cpp b/esphome/components/hdc1080/hdc1080.cpp index 4c66309e5f..956d01ed82 100644 --- a/esphome/components/hdc1080/hdc1080.cpp +++ b/esphome/components/hdc1080/hdc1080.cpp @@ -31,7 +31,7 @@ void HDC1080Component::dump_config() { ESP_LOGCONFIG(TAG, "HDC1080:"); LOG_I2C_DEVICE(this); if (this->is_failed()) { - ESP_LOGE(TAG, "Communication with HDC1080 failed!"); + ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL); } LOG_UPDATE_INTERVAL(this); LOG_SENSOR(" ", "Temperature", this->temperature_); diff --git a/esphome/components/hm3301/hm3301.cpp b/esphome/components/hm3301/hm3301.cpp index c03f5f9869..b165e361ff 100644 --- a/esphome/components/hm3301/hm3301.cpp +++ b/esphome/components/hm3301/hm3301.cpp @@ -23,7 +23,7 @@ void HM3301Component::dump_config() { ESP_LOGCONFIG(TAG, "HM3301:"); LOG_I2C_DEVICE(this); if (error_code_ == ERROR_COMM) { - ESP_LOGE(TAG, "Communication with HM3301 failed!"); + ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL); } LOG_SENSOR(" ", "PM1.0", this->pm_1_0_sensor_); diff --git a/esphome/components/hmc5883l/hmc5883l.cpp b/esphome/components/hmc5883l/hmc5883l.cpp index 3b7a990dcc..fe90b25af2 100644 --- a/esphome/components/hmc5883l/hmc5883l.cpp +++ b/esphome/components/hmc5883l/hmc5883l.cpp @@ -73,7 +73,7 @@ void HMC5883LComponent::dump_config() { ESP_LOGCONFIG(TAG, "HMC5883L:"); LOG_I2C_DEVICE(this); if (this->error_code_ == COMMUNICATION_FAILED) { - ESP_LOGE(TAG, "Communication with HMC5883L failed!"); + ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL); } else if (this->error_code_ == ID_REGISTERS) { ESP_LOGE(TAG, "The ID registers don't match - Is this really an HMC5883L?"); } diff --git a/esphome/components/honeywell_hih_i2c/honeywell_hih.cpp b/esphome/components/honeywell_hih_i2c/honeywell_hih.cpp index 64d5ddb541..5f2b009972 100644 --- a/esphome/components/honeywell_hih_i2c/honeywell_hih.cpp +++ b/esphome/components/honeywell_hih_i2c/honeywell_hih.cpp @@ -17,7 +17,7 @@ void HoneywellHIComponent::read_sensor_data_() { uint8_t data[4]; if (this->read(data, sizeof(data)) != i2c::ERROR_OK) { - ESP_LOGE(TAG, "Communication with Honeywell HIH failed!"); + ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL); this->mark_failed(); return; } @@ -37,7 +37,7 @@ void HoneywellHIComponent::read_sensor_data_() { void HoneywellHIComponent::start_measurement_() { if (this->write(REQUEST_CMD, sizeof(REQUEST_CMD)) != i2c::ERROR_OK) { - ESP_LOGE(TAG, "Communication with Honeywell HIH failed!"); + ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL); this->mark_failed(); return; } @@ -49,7 +49,7 @@ bool HoneywellHIComponent::is_measurement_ready_() { uint8_t data[1]; if (this->read(data, sizeof(data)) != i2c::ERROR_OK) { - ESP_LOGE(TAG, "Communication with Honeywell HIH failed!"); + ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL); this->mark_failed(); return false; } @@ -84,7 +84,7 @@ void HoneywellHIComponent::dump_config() { ESP_LOGD(TAG, "Honeywell HIH:"); LOG_I2C_DEVICE(this); if (this->is_failed()) { - ESP_LOGE(TAG, "Communication with Honeywell HIH failed!"); + ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL); } LOG_SENSOR(" ", "Temperature", this->temperature_sensor_); LOG_SENSOR(" ", "Humidity", this->humidity_sensor_); diff --git a/esphome/components/honeywellabp2_i2c/honeywellabp2.cpp b/esphome/components/honeywellabp2_i2c/honeywellabp2.cpp index d111723669..598f69d226 100644 --- a/esphome/components/honeywellabp2_i2c/honeywellabp2.cpp +++ b/esphome/components/honeywellabp2_i2c/honeywellabp2.cpp @@ -14,7 +14,7 @@ static const char *const TAG = "honeywellabp2"; void HONEYWELLABP2Sensor::read_sensor_data() { if (this->read(raw_data_, 7) != i2c::ERROR_OK) { - ESP_LOGE(TAG, "Communication with ABP2 failed!"); + ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL); this->status_set_warning("couldn't read sensor data"); return; } @@ -30,7 +30,7 @@ void HONEYWELLABP2Sensor::read_sensor_data() { void HONEYWELLABP2Sensor::start_measurement() { if (this->write(i2c_cmd_, 3) != i2c::ERROR_OK) { - ESP_LOGE(TAG, "Communication with ABP2 failed!"); + ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL); this->status_set_warning("couldn't start measurement"); return; } @@ -39,7 +39,7 @@ void HONEYWELLABP2Sensor::start_measurement() { bool HONEYWELLABP2Sensor::is_measurement_ready() { if (this->read(raw_data_, 1) != i2c::ERROR_OK) { - ESP_LOGE(TAG, "Communication with ABP2 failed!"); + ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL); this->status_set_warning("couldn't check measurement"); return false; } diff --git a/esphome/components/hte501/hte501.cpp b/esphome/components/hte501/hte501.cpp index 2aed4729d5..e40d53b52d 100644 --- a/esphome/components/hte501/hte501.cpp +++ b/esphome/components/hte501/hte501.cpp @@ -25,7 +25,7 @@ void HTE501Component::dump_config() { LOG_I2C_DEVICE(this); switch (this->error_code_) { case COMMUNICATION_FAILED: - ESP_LOGE(TAG, "Communication with HTE501 failed!"); + ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL); break; case CRC_CHECK_FAILED: ESP_LOGE(TAG, "The crc check failed"); diff --git a/esphome/components/htu21d/htu21d.cpp b/esphome/components/htu21d/htu21d.cpp index b9c2b346f0..b5d6ad45d5 100644 --- a/esphome/components/htu21d/htu21d.cpp +++ b/esphome/components/htu21d/htu21d.cpp @@ -32,7 +32,7 @@ void HTU21DComponent::dump_config() { ESP_LOGCONFIG(TAG, "HTU21D:"); LOG_I2C_DEVICE(this); if (this->is_failed()) { - ESP_LOGE(TAG, "Communication with HTU21D failed!"); + ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL); } LOG_UPDATE_INTERVAL(this); LOG_SENSOR(" ", "Temperature", this->temperature_); diff --git a/esphome/components/htu31d/htu31d.cpp b/esphome/components/htu31d/htu31d.cpp index b8cdfbd98e..284548ed96 100644 --- a/esphome/components/htu31d/htu31d.cpp +++ b/esphome/components/htu31d/htu31d.cpp @@ -161,7 +161,7 @@ void HTU31DComponent::dump_config() { ESP_LOGCONFIG(TAG, "HTU31D:"); LOG_I2C_DEVICE(this); if (this->is_failed()) { - ESP_LOGE(TAG, "Communication with HTU31D failed!"); + ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL); } LOG_UPDATE_INTERVAL(this); LOG_SENSOR(" ", "Temperature", this->temperature_); diff --git a/esphome/components/hyt271/hyt271.cpp b/esphome/components/hyt271/hyt271.cpp index 3b81294cfc..f187e054a8 100644 --- a/esphome/components/hyt271/hyt271.cpp +++ b/esphome/components/hyt271/hyt271.cpp @@ -21,14 +21,14 @@ void HYT271Component::update() { if (this->write(&raw_data[0], 0) != i2c::ERROR_OK) { this->status_set_warning(); - ESP_LOGE(TAG, "Communication with HYT271 failed! => Ask new values"); + ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL); return; } this->set_timeout("wait_convert", 50, [this]() { uint8_t raw_data[4]; if (this->read(raw_data, 4) != i2c::ERROR_OK) { this->status_set_warning(); - ESP_LOGE(TAG, "Communication with HYT271 failed! => Read values"); + ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL); return; } uint16_t raw_temperature = ((raw_data[2] << 8) | raw_data[3]) >> 2; diff --git a/esphome/components/iaqcore/iaqcore.cpp b/esphome/components/iaqcore/iaqcore.cpp index 810e8da0b2..27ae776287 100644 --- a/esphome/components/iaqcore/iaqcore.cpp +++ b/esphome/components/iaqcore/iaqcore.cpp @@ -26,7 +26,7 @@ struct SensorData { void IAQCore::setup() { if (this->write(nullptr, 0) != i2c::ERROR_OK) { - ESP_LOGD(TAG, "Communication failed!"); + ESP_LOGD(TAG, ESP_LOG_MSG_COMM_FAIL); this->mark_failed(); return; } @@ -89,7 +89,7 @@ void IAQCore::dump_config() { LOG_I2C_DEVICE(this); LOG_UPDATE_INTERVAL(this); if (this->is_failed()) { - ESP_LOGE(TAG, "Communication with AMS iAQ Core failed!"); + ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL); } LOG_SENSOR(" ", "CO2", this->co2_); LOG_SENSOR(" ", "TVOC", this->tvoc_); diff --git a/esphome/components/ina219/ina219.cpp b/esphome/components/ina219/ina219.cpp index cd59f5016d..8d5271fa84 100644 --- a/esphome/components/ina219/ina219.cpp +++ b/esphome/components/ina219/ina219.cpp @@ -134,7 +134,7 @@ void INA219Component::dump_config() { LOG_I2C_DEVICE(this); if (this->is_failed()) { - ESP_LOGE(TAG, "Communication with INA219 failed!"); + ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL); return; } LOG_UPDATE_INTERVAL(this); diff --git a/esphome/components/ina226/ina226.cpp b/esphome/components/ina226/ina226.cpp index 110d08ab3f..f25e11e2e1 100644 --- a/esphome/components/ina226/ina226.cpp +++ b/esphome/components/ina226/ina226.cpp @@ -88,7 +88,7 @@ void INA226Component::dump_config() { LOG_I2C_DEVICE(this); if (this->is_failed()) { - ESP_LOGE(TAG, "Communication with INA226 failed!"); + ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL); return; } LOG_UPDATE_INTERVAL(this); diff --git a/esphome/components/ina2xx_base/ina2xx_base.cpp b/esphome/components/ina2xx_base/ina2xx_base.cpp index 0baa720b42..82fd1e4d4d 100644 --- a/esphome/components/ina2xx_base/ina2xx_base.cpp +++ b/esphome/components/ina2xx_base/ina2xx_base.cpp @@ -203,7 +203,7 @@ void INA2XX::dump_config() { this->dev_id_); } if (this->is_failed()) { - ESP_LOGE(TAG, "Communication with INA2xx failed!"); + ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL); } LOG_UPDATE_INTERVAL(this); ESP_LOGCONFIG(TAG, " Shunt resistance = %f Ohm", this->shunt_resistance_ohm_); diff --git a/esphome/components/ina3221/ina3221.cpp b/esphome/components/ina3221/ina3221.cpp index 771f2d0200..35e79462ab 100644 --- a/esphome/components/ina3221/ina3221.cpp +++ b/esphome/components/ina3221/ina3221.cpp @@ -60,7 +60,7 @@ void INA3221Component::dump_config() { ESP_LOGCONFIG(TAG, "INA3221:"); LOG_I2C_DEVICE(this); if (this->is_failed()) { - ESP_LOGE(TAG, "Communication with INA3221 failed!"); + ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL); } LOG_UPDATE_INTERVAL(this); diff --git a/esphome/components/kamstrup_kmp/kamstrup_kmp.cpp b/esphome/components/kamstrup_kmp/kamstrup_kmp.cpp index b870d1b56d..c058c7b3aa 100644 --- a/esphome/components/kamstrup_kmp/kamstrup_kmp.cpp +++ b/esphome/components/kamstrup_kmp/kamstrup_kmp.cpp @@ -10,7 +10,7 @@ static const char *const TAG = "kamstrup_kmp"; void KamstrupKMPComponent::dump_config() { ESP_LOGCONFIG(TAG, "kamstrup_kmp:"); if (this->is_failed()) { - ESP_LOGE(TAG, "Communication with Kamstrup meter failed!"); + ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL); } LOG_UPDATE_INTERVAL(this); diff --git a/esphome/components/lcd_pcf8574/pcf8574_display.cpp b/esphome/components/lcd_pcf8574/pcf8574_display.cpp index 24774eccdb..90ba3ba876 100644 --- a/esphome/components/lcd_pcf8574/pcf8574_display.cpp +++ b/esphome/components/lcd_pcf8574/pcf8574_display.cpp @@ -26,7 +26,7 @@ void PCF8574LCDDisplay::dump_config() { LOG_I2C_DEVICE(this); LOG_UPDATE_INTERVAL(this); if (this->is_failed()) { - ESP_LOGE(TAG, "Communication with LCD Display failed!"); + ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL); } } void PCF8574LCDDisplay::write_n_bits(uint8_t value, uint8_t n) { diff --git a/esphome/components/ltr501/ltr501.cpp b/esphome/components/ltr501/ltr501.cpp index 909c2cc1ab..9fbc3f3b13 100644 --- a/esphome/components/ltr501/ltr501.cpp +++ b/esphome/components/ltr501/ltr501.cpp @@ -113,7 +113,7 @@ void LTRAlsPs501Component::dump_config() { LOG_SENSOR(" ", "Actual gain", this->actual_gain_sensor_); if (this->is_failed()) { - ESP_LOGE(TAG, "Communication with I2C LTR-501/301/558 failed!"); + ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL); } } diff --git a/esphome/components/ltr_als_ps/ltr_als_ps.cpp b/esphome/components/ltr_als_ps/ltr_als_ps.cpp index aec9d32e5c..402fd1318b 100644 --- a/esphome/components/ltr_als_ps/ltr_als_ps.cpp +++ b/esphome/components/ltr_als_ps/ltr_als_ps.cpp @@ -105,7 +105,7 @@ void LTRAlsPsComponent::dump_config() { LOG_UPDATE_INTERVAL(this); if (this->is_failed()) { - ESP_LOGE(TAG, "Communication with I2C LTR-303/329/55x/659 failed!"); + ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL); } } diff --git a/esphome/components/max17043/max17043.cpp b/esphome/components/max17043/max17043.cpp index c5b24b32b4..dc61babc7e 100644 --- a/esphome/components/max17043/max17043.cpp +++ b/esphome/components/max17043/max17043.cpp @@ -76,7 +76,7 @@ void MAX17043Component::dump_config() { ESP_LOGCONFIG(TAG, "MAX17043:"); LOG_I2C_DEVICE(this); if (this->is_failed()) { - ESP_LOGE(TAG, "Communication with MAX17043 failed"); + ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL); } LOG_UPDATE_INTERVAL(this); LOG_SENSOR(" ", "Battery Voltage", this->voltage_sensor_); diff --git a/esphome/components/max44009/max44009.cpp b/esphome/components/max44009/max44009.cpp index 34963d1fc6..6d1ce351d4 100644 --- a/esphome/components/max44009/max44009.cpp +++ b/esphome/components/max44009/max44009.cpp @@ -48,7 +48,7 @@ void MAX44009Sensor::dump_config() { ESP_LOGCONFIG(TAG, "MAX44009:"); LOG_I2C_DEVICE(this); if (this->is_failed()) { - ESP_LOGE(TAG, "Communication with MAX44009 failed!"); + ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL); } } diff --git a/esphome/components/mcp4725/mcp4725.cpp b/esphome/components/mcp4725/mcp4725.cpp index 78fc45399d..8b2f8524d8 100644 --- a/esphome/components/mcp4725/mcp4725.cpp +++ b/esphome/components/mcp4725/mcp4725.cpp @@ -20,7 +20,7 @@ void MCP4725::dump_config() { LOG_I2C_DEVICE(this); if (this->error_code_ == COMMUNICATION_FAILED) { - ESP_LOGE(TAG, "Communication with MCP4725 failed!"); + ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL); } } diff --git a/esphome/components/mcp4728/mcp4728.cpp b/esphome/components/mcp4728/mcp4728.cpp index 5b2b358c76..7b2b43d4d8 100644 --- a/esphome/components/mcp4728/mcp4728.cpp +++ b/esphome/components/mcp4728/mcp4728.cpp @@ -21,7 +21,7 @@ void MCP4728Component::dump_config() { ESP_LOGCONFIG(TAG, "MCP4728:"); LOG_I2C_DEVICE(this); if (this->is_failed()) { - ESP_LOGE(TAG, "Communication with MCP4728 failed!"); + ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL); } } diff --git a/esphome/components/mcp9808/mcp9808.cpp b/esphome/components/mcp9808/mcp9808.cpp index cb2e9869dd..02ddc1aceb 100644 --- a/esphome/components/mcp9808/mcp9808.cpp +++ b/esphome/components/mcp9808/mcp9808.cpp @@ -23,13 +23,13 @@ void MCP9808Sensor::setup() { uint16_t manu = 0; if (!this->read_byte_16(MCP9808_REG_MANUF_ID, &manu) || manu != MCP9808_MANUF_ID) { this->mark_failed(); - ESP_LOGE(TAG, "%s manufacuturer id failed, device returned %X", this->name_.c_str(), manu); + ESP_LOGE(TAG, "Incorrect manufacturer ID (%X) for '%s'", manu, this->name_.c_str()); return; } uint16_t dev_id = 0; if (!this->read_byte_16(MCP9808_REG_DEVICE_ID, &dev_id) || dev_id != MCP9808_DEV_ID) { this->mark_failed(); - ESP_LOGE(TAG, "%s device id failed, device returned %X", this->name_.c_str(), dev_id); + ESP_LOGE(TAG, "Incorrect device ID (%X) for '%s'", dev_id, this->name_.c_str()); return; } } @@ -37,7 +37,7 @@ void MCP9808Sensor::dump_config() { ESP_LOGCONFIG(TAG, "%s:", this->name_.c_str()); LOG_I2C_DEVICE(this); if (this->is_failed()) { - ESP_LOGE(TAG, "Communication with %s failed!", this->name_.c_str()); + ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL_FOR, this->name_.c_str()); } LOG_UPDATE_INTERVAL(this); LOG_SENSOR(" ", "Temperature", this); diff --git a/esphome/components/mlx90393/sensor_mlx90393.cpp b/esphome/components/mlx90393/sensor_mlx90393.cpp index 1a84c66b1b..96749cd378 100644 --- a/esphome/components/mlx90393/sensor_mlx90393.cpp +++ b/esphome/components/mlx90393/sensor_mlx90393.cpp @@ -122,7 +122,7 @@ void MLX90393Cls::dump_config() { LOG_I2C_DEVICE(this); if (this->is_failed()) { - ESP_LOGE(TAG, "Communication with MLX90393 failed!"); + ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL); return; } LOG_UPDATE_INTERVAL(this); diff --git a/esphome/components/mlx90614/mlx90614.cpp b/esphome/components/mlx90614/mlx90614.cpp index c35e53a168..97888b59bd 100644 --- a/esphome/components/mlx90614/mlx90614.cpp +++ b/esphome/components/mlx90614/mlx90614.cpp @@ -29,7 +29,7 @@ static const char *const TAG = "mlx90614"; void MLX90614Component::setup() { ESP_LOGCONFIG(TAG, "Running setup"); if (!this->write_emissivity_()) { - ESP_LOGE(TAG, "Communication with MLX90614 failed!"); + ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL); this->mark_failed(); return; } @@ -79,7 +79,7 @@ void MLX90614Component::dump_config() { ESP_LOGCONFIG(TAG, "MLX90614:"); LOG_I2C_DEVICE(this); if (this->is_failed()) { - ESP_LOGE(TAG, "Communication with MLX90614 failed!"); + ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL); } LOG_UPDATE_INTERVAL(this); LOG_SENSOR(" ", "Ambient", this->ambient_sensor_); diff --git a/esphome/components/mmc5603/mmc5603.cpp b/esphome/components/mmc5603/mmc5603.cpp index 3590b7e211..86b1b23c15 100644 --- a/esphome/components/mmc5603/mmc5603.cpp +++ b/esphome/components/mmc5603/mmc5603.cpp @@ -79,7 +79,7 @@ void MMC5603Component::dump_config() { ESP_LOGCONFIG(TAG, "MMC5603:"); LOG_I2C_DEVICE(this); if (this->error_code_ == COMMUNICATION_FAILED) { - ESP_LOGE(TAG, "Communication with MMC5603 failed!"); + ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL); } else if (this->error_code_ == ID_REGISTERS) { ESP_LOGE(TAG, "The ID registers don't match - Is this really an MMC5603?"); } diff --git a/esphome/components/mpl3115a2/mpl3115a2.cpp b/esphome/components/mpl3115a2/mpl3115a2.cpp index 1d8baddf6b..d415b77294 100644 --- a/esphome/components/mpl3115a2/mpl3115a2.cpp +++ b/esphome/components/mpl3115a2/mpl3115a2.cpp @@ -37,7 +37,7 @@ void MPL3115A2Component::dump_config() { if (this->is_failed()) { switch (this->error_code_) { case COMMUNICATION_FAILED: - ESP_LOGE(TAG, "Communication with MPL3115A2 failed!"); + ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL); break; case WRONG_ID: ESP_LOGE(TAG, "MPL3115A2 has invalid id"); diff --git a/esphome/components/mpr121/mpr121.cpp b/esphome/components/mpr121/mpr121.cpp index 1965e5d5bc..39c45d7a89 100644 --- a/esphome/components/mpr121/mpr121.cpp +++ b/esphome/components/mpr121/mpr121.cpp @@ -72,7 +72,7 @@ void MPR121Component::dump_config() { LOG_I2C_DEVICE(this); switch (this->error_code_) { case COMMUNICATION_FAILED: - ESP_LOGE(TAG, "Communication with MPR121 failed!"); + ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL); break; case WRONG_CHIP_STATE: ESP_LOGE(TAG, "MPR121 has wrong default value for CONFIG2?"); diff --git a/esphome/components/mpu6050/mpu6050.cpp b/esphome/components/mpu6050/mpu6050.cpp index 1fb5a4cee6..127d84e816 100644 --- a/esphome/components/mpu6050/mpu6050.cpp +++ b/esphome/components/mpu6050/mpu6050.cpp @@ -86,7 +86,7 @@ void MPU6050Component::dump_config() { ESP_LOGCONFIG(TAG, "MPU6050:"); LOG_I2C_DEVICE(this); if (this->is_failed()) { - ESP_LOGE(TAG, "Communication with MPU6050 failed!"); + ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL); } LOG_UPDATE_INTERVAL(this); LOG_SENSOR(" ", "Acceleration X", this->accel_x_sensor_); diff --git a/esphome/components/mpu6886/mpu6886.cpp b/esphome/components/mpu6886/mpu6886.cpp index b2100e573a..8f3adeed8d 100644 --- a/esphome/components/mpu6886/mpu6886.cpp +++ b/esphome/components/mpu6886/mpu6886.cpp @@ -91,7 +91,7 @@ void MPU6886Component::dump_config() { ESP_LOGCONFIG(TAG, "MPU6886:"); LOG_I2C_DEVICE(this); if (this->is_failed()) { - ESP_LOGE(TAG, "Communication with MPU6886 failed!"); + ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL); } LOG_UPDATE_INTERVAL(this); LOG_SENSOR(" ", "Acceleration X", this->accel_x_sensor_); diff --git a/esphome/components/ms5611/ms5611.cpp b/esphome/components/ms5611/ms5611.cpp index a302ea84df..7a820f3b5a 100644 --- a/esphome/components/ms5611/ms5611.cpp +++ b/esphome/components/ms5611/ms5611.cpp @@ -32,7 +32,7 @@ void MS5611Component::dump_config() { ESP_LOGCONFIG(TAG, "MS5611:"); LOG_I2C_DEVICE(this); if (this->is_failed()) { - ESP_LOGE(TAG, "Communication with MS5611 failed!"); + ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL); } LOG_UPDATE_INTERVAL(this); LOG_SENSOR(" ", "Temperature", this->temperature_sensor_); diff --git a/esphome/components/ms8607/ms8607.cpp b/esphome/components/ms8607/ms8607.cpp index d1da1aabe6..b985623b24 100644 --- a/esphome/components/ms8607/ms8607.cpp +++ b/esphome/components/ms8607/ms8607.cpp @@ -140,7 +140,7 @@ void MS8607Component::dump_config() { // LOG_I2C_DEVICE doesn't work for humidity, the `address_` is protected. Log using get_address() ESP_LOGCONFIG(TAG, " Address: 0x%02X", this->humidity_device_->get_address()); if (this->is_failed()) { - ESP_LOGE(TAG, "Communication with MS8607 failed."); + ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL); switch (this->error_code_) { case ErrorCode::PT_RESET_FAILED: ESP_LOGE(TAG, "Temperature/Pressure RESET failed"); diff --git a/esphome/components/msa3xx/msa3xx.cpp b/esphome/components/msa3xx/msa3xx.cpp index 0517bc6648..75aa139e88 100644 --- a/esphome/components/msa3xx/msa3xx.cpp +++ b/esphome/components/msa3xx/msa3xx.cpp @@ -159,7 +159,7 @@ void MSA3xxComponent::dump_config() { ESP_LOGCONFIG(TAG, "MSA3xx:"); LOG_I2C_DEVICE(this); if (this->is_failed()) { - ESP_LOGE(TAG, "Communication with MSA3xx failed!"); + ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL); } ESP_LOGCONFIG(TAG, " Model: %s", model_to_string(this->model_)); ESP_LOGCONFIG(TAG, " Power Mode: %s", power_mode_to_string(this->power_mode_)); diff --git a/esphome/components/nau7802/nau7802.cpp b/esphome/components/nau7802/nau7802.cpp index c9088d89ee..fa4c4b64a1 100644 --- a/esphome/components/nau7802/nau7802.cpp +++ b/esphome/components/nau7802/nau7802.cpp @@ -127,7 +127,7 @@ void NAU7802Sensor::dump_config() { LOG_I2C_DEVICE(this); if (this->is_failed()) { - ESP_LOGE(TAG, "Communication with NAU7802 failed earlier, during setup"); + ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL_FOR, this->get_name().c_str()); return; } // Note these may differ from the values on the device if calbration has been run diff --git a/esphome/components/npi19/npi19.cpp b/esphome/components/npi19/npi19.cpp index 41c3f78bf5..3da5a9dbf8 100644 --- a/esphome/components/npi19/npi19.cpp +++ b/esphome/components/npi19/npi19.cpp @@ -17,12 +17,10 @@ void NPI19Component::setup() { uint16_t raw_pressure(0); i2c::ErrorCode err = this->read_(raw_temperature, raw_pressure); if (err != i2c::ERROR_OK) { - ESP_LOGCONFIG(TAG, " I2C Communication Failed..."); + ESP_LOGCONFIG(TAG, ESP_LOG_MSG_COMM_FAIL); this->mark_failed(); return; } - - ESP_LOGCONFIG(TAG, " Success..."); } void NPI19Component::dump_config() { @@ -90,7 +88,7 @@ void NPI19Component::update() { i2c::ErrorCode err = this->read_(raw_temperature, raw_pressure); if (err != i2c::ERROR_OK) { - ESP_LOGW(TAG, "I2C Communication Failed"); + ESP_LOGW(TAG, ESP_LOG_MSG_COMM_FAIL); this->status_set_warning(); return; } diff --git a/esphome/components/pca6416a/pca6416a.cpp b/esphome/components/pca6416a/pca6416a.cpp index 6c188c6310..3e76df5015 100644 --- a/esphome/components/pca6416a/pca6416a.cpp +++ b/esphome/components/pca6416a/pca6416a.cpp @@ -60,7 +60,7 @@ void PCA6416AComponent::dump_config() { } LOG_I2C_DEVICE(this) if (this->is_failed()) { - ESP_LOGE(TAG, "Communication with PCA6416A failed!"); + ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL); } } diff --git a/esphome/components/pca9554/pca9554.cpp b/esphome/components/pca9554/pca9554.cpp index f5de78996e..fe4375c171 100644 --- a/esphome/components/pca9554/pca9554.cpp +++ b/esphome/components/pca9554/pca9554.cpp @@ -49,7 +49,7 @@ void PCA9554Component::dump_config() { ESP_LOGCONFIG(TAG, " I/O Pins: %d", this->pin_count_); LOG_I2C_DEVICE(this) if (this->is_failed()) { - ESP_LOGE(TAG, "Communication with PCA9554 failed!"); + ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL); } } diff --git a/esphome/components/pcf85063/pcf85063.cpp b/esphome/components/pcf85063/pcf85063.cpp index a72af1b49b..d58d35019b 100644 --- a/esphome/components/pcf85063/pcf85063.cpp +++ b/esphome/components/pcf85063/pcf85063.cpp @@ -22,7 +22,7 @@ void PCF85063Component::dump_config() { ESP_LOGCONFIG(TAG, "PCF85063:"); LOG_I2C_DEVICE(this); if (this->is_failed()) { - ESP_LOGE(TAG, "Communication with PCF85063 failed!"); + ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL); } ESP_LOGCONFIG(TAG, " Timezone: '%s'", this->timezone_.c_str()); } diff --git a/esphome/components/pcf8563/pcf8563.cpp b/esphome/components/pcf8563/pcf8563.cpp index 817e87c090..7dd7a6fea8 100644 --- a/esphome/components/pcf8563/pcf8563.cpp +++ b/esphome/components/pcf8563/pcf8563.cpp @@ -22,7 +22,7 @@ void PCF8563Component::dump_config() { ESP_LOGCONFIG(TAG, "PCF8563:"); LOG_I2C_DEVICE(this); if (this->is_failed()) { - ESP_LOGE(TAG, "Communication with PCF8563 failed!"); + ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL); } ESP_LOGCONFIG(TAG, " Timezone: '%s'", this->timezone_.c_str()); } diff --git a/esphome/components/pcf8574/pcf8574.cpp b/esphome/components/pcf8574/pcf8574.cpp index 76ef5ff448..dbab0319d7 100644 --- a/esphome/components/pcf8574/pcf8574.cpp +++ b/esphome/components/pcf8574/pcf8574.cpp @@ -22,7 +22,7 @@ void PCF8574Component::dump_config() { LOG_I2C_DEVICE(this) ESP_LOGCONFIG(TAG, " Is PCF8575: %s", YESNO(this->pcf8575_)); if (this->is_failed()) { - ESP_LOGE(TAG, "Communication with PCF8574 failed!"); + ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL); } } bool PCF8574Component::digital_read(uint8_t pin) { diff --git a/esphome/components/pm2005/pm2005.cpp b/esphome/components/pm2005/pm2005.cpp index affa35f926..4b00cd6f2e 100644 --- a/esphome/components/pm2005/pm2005.cpp +++ b/esphome/components/pm2005/pm2005.cpp @@ -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_); diff --git a/esphome/components/pmwcs3/pmwcs3.cpp b/esphome/components/pmwcs3/pmwcs3.cpp index d29b6a1fd2..95638851b5 100644 --- a/esphome/components/pmwcs3/pmwcs3.cpp +++ b/esphome/components/pmwcs3/pmwcs3.cpp @@ -59,7 +59,7 @@ void PMWCS3Component::dump_config() { ESP_LOGCONFIG(TAG, "PMWCS3"); LOG_I2C_DEVICE(this); if (this->is_failed()) { - ESP_LOGE(TAG, "Communication failed"); + ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL); } LOG_UPDATE_INTERVAL(this); LOG_SENSOR(" ", "e25", this->e25_sensor_); diff --git a/esphome/components/qmc5883l/qmc5883l.cpp b/esphome/components/qmc5883l/qmc5883l.cpp index 0c67ec61f6..e41d7de644 100644 --- a/esphome/components/qmc5883l/qmc5883l.cpp +++ b/esphome/components/qmc5883l/qmc5883l.cpp @@ -69,7 +69,7 @@ void QMC5883LComponent::dump_config() { ESP_LOGCONFIG(TAG, "QMC5883L:"); LOG_I2C_DEVICE(this); if (this->error_code_ == COMMUNICATION_FAILED) { - ESP_LOGE(TAG, "Communication with QMC5883L failed!"); + ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL); } LOG_UPDATE_INTERVAL(this); diff --git a/esphome/components/qmp6988/qmp6988.cpp b/esphome/components/qmp6988/qmp6988.cpp index a85cf98b96..4c81e124ba 100644 --- a/esphome/components/qmp6988/qmp6988.cpp +++ b/esphome/components/qmp6988/qmp6988.cpp @@ -368,7 +368,7 @@ void QMP6988Component::dump_config() { ESP_LOGCONFIG(TAG, "QMP6988:"); LOG_I2C_DEVICE(this); if (this->is_failed()) { - ESP_LOGE(TAG, "Communication with QMP6988 failed!"); + ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL); } LOG_UPDATE_INTERVAL(this); diff --git a/esphome/components/qwiic_pir/qwiic_pir.cpp b/esphome/components/qwiic_pir/qwiic_pir.cpp index 6b9cc329a7..df9da561a2 100644 --- a/esphome/components/qwiic_pir/qwiic_pir.cpp +++ b/esphome/components/qwiic_pir/qwiic_pir.cpp @@ -58,7 +58,7 @@ void QwiicPIRComponent::setup() { void QwiicPIRComponent::loop() { // Read Event Register if (!this->read_byte(QWIIC_PIR_EVENT_STATUS, &this->event_register_.reg)) { - ESP_LOGW(TAG, "Failed to communicate with sensor"); + ESP_LOGW(TAG, ESP_LOG_MSG_COMM_FAIL); return; } diff --git a/esphome/components/scd30/scd30.cpp b/esphome/components/scd30/scd30.cpp index ac76f29c51..a7283eb680 100644 --- a/esphome/components/scd30/scd30.cpp +++ b/esphome/components/scd30/scd30.cpp @@ -122,16 +122,16 @@ void SCD30Component::dump_config() { if (this->is_failed()) { switch (this->error_code_) { case COMMUNICATION_FAILED: - ESP_LOGW(TAG, "Communication failed! Is the sensor connected?"); + ESP_LOGW(TAG, ESP_LOG_MSG_COMM_FAIL); break; case MEASUREMENT_INIT_FAILED: - ESP_LOGW(TAG, "Measurement Initialization failed!"); + ESP_LOGW(TAG, "Measurement Initialization failed"); break; case FIRMWARE_IDENTIFICATION_FAILED: ESP_LOGW(TAG, "Unable to read sensor firmware version"); break; default: - ESP_LOGW(TAG, "Unknown setup error!"); + ESP_LOGW(TAG, "Unknown setup error"); break; } } diff --git a/esphome/components/scd4x/scd4x.cpp b/esphome/components/scd4x/scd4x.cpp index 6caaca51b2..8cd81f802f 100644 --- a/esphome/components/scd4x/scd4x.cpp +++ b/esphome/components/scd4x/scd4x.cpp @@ -96,16 +96,16 @@ void SCD4XComponent::dump_config() { if (this->is_failed()) { switch (this->error_code_) { case COMMUNICATION_FAILED: - ESP_LOGW(TAG, "Communication failed! Is the sensor connected?"); + ESP_LOGW(TAG, ESP_LOG_MSG_COMM_FAIL); break; case MEASUREMENT_INIT_FAILED: - ESP_LOGW(TAG, "Measurement Initialization failed!"); + ESP_LOGW(TAG, "Measurement Initialization failed"); break; case SERIAL_NUMBER_IDENTIFICATION_FAILED: ESP_LOGW(TAG, "Unable to read sensor firmware version"); break; default: - ESP_LOGW(TAG, "Unknown setup error!"); + ESP_LOGW(TAG, "Unknown setup error"); break; } } diff --git a/esphome/components/sen0321/sen0321.cpp b/esphome/components/sen0321/sen0321.cpp index b754876488..c727dda0b1 100644 --- a/esphome/components/sen0321/sen0321.cpp +++ b/esphome/components/sen0321/sen0321.cpp @@ -21,7 +21,7 @@ void Sen0321Sensor::dump_config() { ESP_LOGCONFIG(TAG, "DF Robot Ozone Sensor sen0321:"); LOG_I2C_DEVICE(this); if (this->is_failed()) { - ESP_LOGE(TAG, "Communication with sen0321 failed!"); + ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL); } LOG_UPDATE_INTERVAL(this); } diff --git a/esphome/components/sen21231/sen21231.cpp b/esphome/components/sen21231/sen21231.cpp index aa123dff62..67001c3f14 100644 --- a/esphome/components/sen21231/sen21231.cpp +++ b/esphome/components/sen21231/sen21231.cpp @@ -12,7 +12,7 @@ void Sen21231Sensor::dump_config() { ESP_LOGCONFIG(TAG, "SEN21231:"); LOG_I2C_DEVICE(this); if (this->is_failed()) { - ESP_LOGE(TAG, "Communication with SEN21231 failed!"); + ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL); } ESP_LOGI(TAG, "SEN21231: %s", this->is_failed() ? "FAILED" : "OK"); LOG_UPDATE_INTERVAL(this); diff --git a/esphome/components/sen5x/sen5x.cpp b/esphome/components/sen5x/sen5x.cpp index 04e1a4db0e..d7e1f5f62e 100644 --- a/esphome/components/sen5x/sen5x.cpp +++ b/esphome/components/sen5x/sen5x.cpp @@ -245,10 +245,10 @@ void SEN5XComponent::dump_config() { if (this->is_failed()) { switch (this->error_code_) { case COMMUNICATION_FAILED: - ESP_LOGW(TAG, "Communication failed! Is the sensor connected?"); + ESP_LOGW(TAG, ESP_LOG_MSG_COMM_FAIL); break; case MEASUREMENT_INIT_FAILED: - ESP_LOGW(TAG, "Measurement Initialization failed!"); + ESP_LOGW(TAG, "Measurement Initialization failed"); break; case SERIAL_NUMBER_IDENTIFICATION_FAILED: ESP_LOGW(TAG, "Unable to read sensor serial id"); @@ -260,7 +260,7 @@ void SEN5XComponent::dump_config() { ESP_LOGW(TAG, "Unable to read sensor firmware version"); break; default: - ESP_LOGW(TAG, "Unknown setup error!"); + ESP_LOGW(TAG, "Unknown setup error"); break; } } diff --git a/esphome/components/sgp30/sgp30.cpp b/esphome/components/sgp30/sgp30.cpp index bf19ea1bbf..21f98602eb 100644 --- a/esphome/components/sgp30/sgp30.cpp +++ b/esphome/components/sgp30/sgp30.cpp @@ -232,19 +232,19 @@ void SGP30Component::dump_config() { if (this->is_failed()) { switch (this->error_code_) { case COMMUNICATION_FAILED: - ESP_LOGW(TAG, "Communication failed! Is the sensor connected?"); + ESP_LOGW(TAG, ESP_LOG_MSG_COMM_FAIL); break; case MEASUREMENT_INIT_FAILED: - ESP_LOGW(TAG, "Measurement Initialization failed!"); + ESP_LOGW(TAG, "Measurement Initialization failed"); break; case INVALID_ID: ESP_LOGW(TAG, "Sensor reported an invalid ID. Is this an SGP30?"); break; case UNSUPPORTED_ID: - ESP_LOGW(TAG, "Sensor reported an unsupported ID (SGPC3)."); + ESP_LOGW(TAG, "Sensor reported an unsupported ID (SGPC3)"); break; default: - ESP_LOGW(TAG, "Unknown setup error!"); + ESP_LOGW(TAG, "Unknown setup error"); break; } } else { diff --git a/esphome/components/sgp4x/sgp4x.cpp b/esphome/components/sgp4x/sgp4x.cpp index 963f0f062a..1571a8c1e3 100644 --- a/esphome/components/sgp4x/sgp4x.cpp +++ b/esphome/components/sgp4x/sgp4x.cpp @@ -275,17 +275,17 @@ void SGP4xComponent::dump_config() { if (this->is_failed()) { switch (this->error_code_) { case COMMUNICATION_FAILED: - ESP_LOGW(TAG, "Communication failed! Is the sensor connected?"); + ESP_LOGW(TAG, ESP_LOG_MSG_COMM_FAIL); break; case SERIAL_NUMBER_IDENTIFICATION_FAILED: - ESP_LOGW(TAG, "Get Serial number failed."); + ESP_LOGW(TAG, "Get Serial number failed"); break; case SELF_TEST_FAILED: - ESP_LOGW(TAG, "Self test failed."); + ESP_LOGW(TAG, "Self test failed"); break; default: - ESP_LOGW(TAG, "Unknown setup error!"); + ESP_LOGW(TAG, "Unknown setup error"); break; } } else { diff --git a/esphome/components/sht4x/sht4x.cpp b/esphome/components/sht4x/sht4x.cpp index 79a59bb9b8..944b13023e 100644 --- a/esphome/components/sht4x/sht4x.cpp +++ b/esphome/components/sht4x/sht4x.cpp @@ -59,7 +59,7 @@ void SHT4XComponent::dump_config() { ESP_LOGCONFIG(TAG, "SHT4x:"); LOG_I2C_DEVICE(this); if (this->is_failed()) { - ESP_LOGE(TAG, "Communication with SHT4x failed!"); + ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL); } } diff --git a/esphome/components/shtcx/shtcx.cpp b/esphome/components/shtcx/shtcx.cpp index 42e566bc80..770bcf6c6d 100644 --- a/esphome/components/shtcx/shtcx.cpp +++ b/esphome/components/shtcx/shtcx.cpp @@ -60,7 +60,7 @@ void SHTCXComponent::dump_config() { ESP_LOGCONFIG(TAG, " Model: %s (%04x)", to_string(this->type_), this->sensor_id_); LOG_I2C_DEVICE(this); if (this->is_failed()) { - ESP_LOGE(TAG, "Communication with SHTCx failed!"); + ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL); } LOG_UPDATE_INTERVAL(this); diff --git a/esphome/components/sps30/sps30.cpp b/esphome/components/sps30/sps30.cpp index de4bc70702..5a0335998f 100644 --- a/esphome/components/sps30/sps30.cpp +++ b/esphome/components/sps30/sps30.cpp @@ -73,10 +73,10 @@ void SPS30Component::dump_config() { if (this->is_failed()) { switch (this->error_code_) { case COMMUNICATION_FAILED: - ESP_LOGW(TAG, "Communication failed! Is the sensor connected?"); + ESP_LOGW(TAG, ESP_LOG_MSG_COMM_FAIL); break; case MEASUREMENT_INIT_FAILED: - ESP_LOGW(TAG, "Measurement Initialization failed!"); + ESP_LOGW(TAG, "Measurement Initialization failed"); break; case SERIAL_NUMBER_REQUEST_FAILED: ESP_LOGW(TAG, "Unable to request sensor serial number"); @@ -91,7 +91,7 @@ void SPS30Component::dump_config() { ESP_LOGW(TAG, "Unable to read sensor firmware version"); break; default: - ESP_LOGW(TAG, "Unknown setup error!"); + ESP_LOGW(TAG, "Unknown setup error"); break; } } diff --git a/esphome/components/ssd1306_i2c/ssd1306_i2c.cpp b/esphome/components/ssd1306_i2c/ssd1306_i2c.cpp index aabdf094c4..4013ae7209 100644 --- a/esphome/components/ssd1306_i2c/ssd1306_i2c.cpp +++ b/esphome/components/ssd1306_i2c/ssd1306_i2c.cpp @@ -33,7 +33,7 @@ void I2CSSD1306::dump_config() { LOG_UPDATE_INTERVAL(this); if (this->error_code_ == COMMUNICATION_FAILED) { - ESP_LOGE(TAG, "Communication with SSD1306 failed!"); + ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL); } } void I2CSSD1306::command(uint8_t value) { this->write_byte(0x00, value); } diff --git a/esphome/components/ssd1327_i2c/ssd1327_i2c.cpp b/esphome/components/ssd1327_i2c/ssd1327_i2c.cpp index d8c5f67935..4e1c5e4ea0 100644 --- a/esphome/components/ssd1327_i2c/ssd1327_i2c.cpp +++ b/esphome/components/ssd1327_i2c/ssd1327_i2c.cpp @@ -27,7 +27,7 @@ void I2CSSD1327::dump_config() { LOG_UPDATE_INTERVAL(this); if (this->error_code_ == COMMUNICATION_FAILED) { - ESP_LOGE(TAG, "Communication with SSD1327 failed!"); + ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL); } } void I2CSSD1327::command(uint8_t value) { this->write_byte(0x00, value); } diff --git a/esphome/components/st7567_i2c/st7567_i2c.cpp b/esphome/components/st7567_i2c/st7567_i2c.cpp index 38a92d3c5b..9180409cc0 100644 --- a/esphome/components/st7567_i2c/st7567_i2c.cpp +++ b/esphome/components/st7567_i2c/st7567_i2c.cpp @@ -30,7 +30,7 @@ void I2CST7567::dump_config() { LOG_UPDATE_INTERVAL(this); if (this->error_code_ == COMMUNICATION_FAILED) { - ESP_LOGE(TAG, "Communication with I2C ST7567 failed!"); + ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL); } } diff --git a/esphome/components/sts3x/sts3x.cpp b/esphome/components/sts3x/sts3x.cpp index a66ca6cf4b..29aac24e90 100644 --- a/esphome/components/sts3x/sts3x.cpp +++ b/esphome/components/sts3x/sts3x.cpp @@ -36,7 +36,7 @@ void STS3XComponent::dump_config() { ESP_LOGCONFIG(TAG, "STS3x:"); LOG_I2C_DEVICE(this); if (this->is_failed()) { - ESP_LOGE(TAG, "Communication with ST3x failed!"); + ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL); } LOG_UPDATE_INTERVAL(this); diff --git a/esphome/components/tca9555/tca9555.cpp b/esphome/components/tca9555/tca9555.cpp index 7920e57b9c..7bd2f44918 100644 --- a/esphome/components/tca9555/tca9555.cpp +++ b/esphome/components/tca9555/tca9555.cpp @@ -30,7 +30,7 @@ void TCA9555Component::dump_config() { ESP_LOGCONFIG(TAG, "TCA9555:"); LOG_I2C_DEVICE(this) if (this->is_failed()) { - ESP_LOGE(TAG, "Communication with TCA9555 failed!"); + ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL); } } void TCA9555Component::pin_mode(uint8_t pin, gpio::Flags flags) { diff --git a/esphome/components/tcs34725/tcs34725.cpp b/esphome/components/tcs34725/tcs34725.cpp index 2c5ddd3885..0aed2c8f46 100644 --- a/esphome/components/tcs34725/tcs34725.cpp +++ b/esphome/components/tcs34725/tcs34725.cpp @@ -46,7 +46,7 @@ void TCS34725Component::dump_config() { ESP_LOGCONFIG(TAG, "TCS34725:"); LOG_I2C_DEVICE(this); if (this->is_failed()) { - ESP_LOGE(TAG, "Communication with TCS34725 failed!"); + ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL); } LOG_UPDATE_INTERVAL(this); diff --git a/esphome/components/tee501/tee501.cpp b/esphome/components/tee501/tee501.cpp index 0a5545d09e..329aee7c52 100644 --- a/esphome/components/tee501/tee501.cpp +++ b/esphome/components/tee501/tee501.cpp @@ -25,7 +25,7 @@ void TEE501Component::dump_config() { LOG_I2C_DEVICE(this); switch (this->error_code_) { case COMMUNICATION_FAILED: - ESP_LOGE(TAG, "Communication with TEE501 failed!"); + ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL); break; case CRC_CHECK_FAILED: ESP_LOGE(TAG, "The crc check failed"); diff --git a/esphome/components/tem3200/tem3200.cpp b/esphome/components/tem3200/tem3200.cpp index 2fef26e687..05bf580e11 100644 --- a/esphome/components/tem3200/tem3200.cpp +++ b/esphome/components/tem3200/tem3200.cpp @@ -24,7 +24,7 @@ void TEM3200Component::setup() { i2c::ErrorCode err = this->read_(status, raw_temperature, raw_pressure); if (err != i2c::ERROR_OK) { - ESP_LOGCONFIG(TAG, " I2C Communication Failed..."); + ESP_LOGCONFIG(TAG, ESP_LOG_MSG_COMM_FAIL); this->mark_failed(); return; } @@ -115,7 +115,7 @@ void TEM3200Component::update() { i2c::ErrorCode err = this->read_(status, raw_temperature, raw_pressure); if (err != i2c::ERROR_OK) { - ESP_LOGW(TAG, "I2C Communication Failed"); + ESP_LOGW(TAG, ESP_LOG_MSG_COMM_FAIL); this->status_set_warning(); return; } diff --git a/esphome/components/tmp102/tmp102.cpp b/esphome/components/tmp102/tmp102.cpp index 1b526ed25f..7390d9fcc9 100644 --- a/esphome/components/tmp102/tmp102.cpp +++ b/esphome/components/tmp102/tmp102.cpp @@ -19,7 +19,7 @@ void TMP102Component::dump_config() { ESP_LOGCONFIG(TAG, "TMP102:"); LOG_I2C_DEVICE(this); if (this->is_failed()) { - ESP_LOGE(TAG, "Communication failed"); + ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL); } LOG_UPDATE_INTERVAL(this); LOG_SENSOR(" ", "Temperature", this); diff --git a/esphome/components/tmp1075/tmp1075.cpp b/esphome/components/tmp1075/tmp1075.cpp index 68253a11f1..b8f80e4abe 100644 --- a/esphome/components/tmp1075/tmp1075.cpp +++ b/esphome/components/tmp1075/tmp1075.cpp @@ -44,7 +44,7 @@ void TMP1075Sensor::update() { void TMP1075Sensor::dump_config() { LOG_SENSOR("", "TMP1075 Sensor", this); if (this->is_failed()) { - ESP_LOGE(TAG, " Communication with TMP1075 failed!"); + ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL); return; } ESP_LOGCONFIG(TAG, " limit low : %.4f °C", alert_limit_low_); diff --git a/esphome/components/tmp117/tmp117.cpp b/esphome/components/tmp117/tmp117.cpp index 9ec711367b..5fe8f51414 100644 --- a/esphome/components/tmp117/tmp117.cpp +++ b/esphome/components/tmp117/tmp117.cpp @@ -43,7 +43,7 @@ void TMP117Component::dump_config() { ESP_LOGD(TAG, "TMP117:"); LOG_I2C_DEVICE(this); if (this->is_failed()) { - ESP_LOGE(TAG, "Communication with TMP117 failed!"); + ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL); } LOG_SENSOR(" ", "Temperature", this); } diff --git a/esphome/components/tof10120/tof10120_sensor.cpp b/esphome/components/tof10120/tof10120_sensor.cpp index 32cd604be9..e27c7bbd64 100644 --- a/esphome/components/tof10120/tof10120_sensor.cpp +++ b/esphome/components/tof10120/tof10120_sensor.cpp @@ -27,7 +27,7 @@ void TOF10120Sensor::setup() {} void TOF10120Sensor::update() { if (!this->write_bytes(TOF10120_DISTANCE_REGISTER, TOF10120_READ_DISTANCE_CMD, sizeof(TOF10120_READ_DISTANCE_CMD))) { - ESP_LOGE(TAG, "Communication with TOF10120 failed on write"); + ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL); this->status_set_warning(); return; } @@ -39,7 +39,7 @@ void TOF10120Sensor::update() { } delay(TOF10120_DEFAULT_DELAY); if (this->read(data, 2) != i2c::ERROR_OK) { - ESP_LOGE(TAG, "Communication with TOF10120 failed on read"); + ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL); this->status_set_warning(); return; } diff --git a/esphome/components/tsl2561/tsl2561.cpp b/esphome/components/tsl2561/tsl2561.cpp index c20b119a40..4a24153dd5 100644 --- a/esphome/components/tsl2561/tsl2561.cpp +++ b/esphome/components/tsl2561/tsl2561.cpp @@ -41,7 +41,7 @@ void TSL2561Sensor::dump_config() { LOG_I2C_DEVICE(this); if (this->is_failed()) { - ESP_LOGE(TAG, "Communication with TSL2561 failed!"); + ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL); } int gain = this->gain_ == TSL2561_GAIN_1X ? 1 : 16; diff --git a/esphome/components/tsl2591/tsl2591.cpp b/esphome/components/tsl2591/tsl2591.cpp index 977048364c..7799d727ba 100644 --- a/esphome/components/tsl2591/tsl2591.cpp +++ b/esphome/components/tsl2591/tsl2591.cpp @@ -89,7 +89,7 @@ void TSL2591Component::dump_config() { LOG_I2C_DEVICE(this); if (this->is_failed()) { - ESP_LOGE(TAG, "Communication with TSL2591 failed earlier, during setup"); + ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL); return; } diff --git a/esphome/components/ttp229_lsf/ttp229_lsf.cpp b/esphome/components/ttp229_lsf/ttp229_lsf.cpp index e1bbdb19db..8e976da4ef 100644 --- a/esphome/components/ttp229_lsf/ttp229_lsf.cpp +++ b/esphome/components/ttp229_lsf/ttp229_lsf.cpp @@ -20,7 +20,7 @@ void TTP229LSFComponent::dump_config() { LOG_I2C_DEVICE(this); switch (this->error_code_) { case COMMUNICATION_FAILED: - ESP_LOGE(TAG, "Communication with TTP229 failed!"); + ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL); break; case NONE: default: diff --git a/esphome/components/veml3235/veml3235.cpp b/esphome/components/veml3235/veml3235.cpp index 33a722917f..965e167942 100644 --- a/esphome/components/veml3235/veml3235.cpp +++ b/esphome/components/veml3235/veml3235.cpp @@ -212,7 +212,7 @@ void VEML3235Sensor::dump_config() { LOG_SENSOR("", "VEML3235", this); LOG_I2C_DEVICE(this); if (this->is_failed()) { - ESP_LOGE(TAG, "Communication failed"); + ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL); } LOG_UPDATE_INTERVAL(this); ESP_LOGCONFIG(TAG, " Auto-gain enabled: %s", YESNO(this->auto_gain_)); diff --git a/esphome/components/veml7700/veml7700.cpp b/esphome/components/veml7700/veml7700.cpp index fe287c728c..25f6c761c8 100644 --- a/esphome/components/veml7700/veml7700.cpp +++ b/esphome/components/veml7700/veml7700.cpp @@ -109,7 +109,7 @@ void VEML7700Component::dump_config() { LOG_SENSOR(" ", "Actual integration time", this->actual_integration_time_sensor_); if (this->is_failed()) { - ESP_LOGE(TAG, "Communication with I2C VEML7700/6030 failed!"); + ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL); } } diff --git a/esphome/components/xl9535/xl9535.cpp b/esphome/components/xl9535/xl9535.cpp index 4d6ce2f961..7bcd98070f 100644 --- a/esphome/components/xl9535/xl9535.cpp +++ b/esphome/components/xl9535/xl9535.cpp @@ -22,7 +22,7 @@ void XL9535Component::dump_config() { LOG_I2C_DEVICE(this); if (this->is_failed()) { - ESP_LOGE(TAG, "Communication with XL9535 failed!"); + ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL); } } diff --git a/esphome/core/log.h b/esphome/core/log.h index 9ab80afe78..adf72e4bac 100644 --- a/esphome/core/log.h +++ b/esphome/core/log.h @@ -1,5 +1,7 @@ #pragma once +#include "log_const_en.h" + #include #include // for PRIu32 and friends diff --git a/esphome/core/log_const_en.h b/esphome/core/log_const_en.h new file mode 100644 index 0000000000..75e71ecd81 --- /dev/null +++ b/esphome/core/log_const_en.h @@ -0,0 +1,11 @@ +#pragma once + +#include "defines.h" + +#ifdef USE_ESP8266 +#define ESP_LOG_MSG_COMM_FAIL "Communication failed" +#define ESP_LOG_MSG_COMM_FAIL_FOR "Communication failed for '%s'" +#else +constexpr const char *const ESP_LOG_MSG_COMM_FAIL = "Communication failed"; +constexpr const char *const ESP_LOG_MSG_COMM_FAIL_FOR = "Communication failed for '%s'"; +#endif diff --git a/script/ci-custom.py b/script/ci-custom.py index a3a31b2259..fbabbc1e74 100755 --- a/script/ci-custom.py +++ b/script/ci-custom.py @@ -663,6 +663,7 @@ def lint_trailing_whitespace(fname, match): "esphome/components/valve/valve.h", "esphome/core/component.h", "esphome/core/gpio.h", + "esphome/core/log_const_en.h", "esphome/core/log.h", "tests/custom.h", ],