1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-08 04:43:46 +01:00

Reduce ESP_LOGCONFIG calls (#9026)

This commit is contained in:
J. Nick Koston
2025-06-08 19:02:30 -05:00
committed by GitHub
parent 80dddb4cae
commit c0b05ada1a
218 changed files with 1569 additions and 931 deletions

View File

@@ -85,21 +85,28 @@ void LTRAlsPsComponent::dump_config() {
LOG_I2C_DEVICE(this);
ESP_LOGCONFIG(TAG, " Device type: %s", get_device_type(this->ltr_type_));
if (this->is_als_()) {
ESP_LOGCONFIG(TAG, " Automatic mode: %s", ONOFF(this->automatic_mode_enabled_));
ESP_LOGCONFIG(TAG, " Gain: %.0fx", get_gain_coeff(this->gain_));
ESP_LOGCONFIG(TAG, " Integration time: %d ms", get_itime_ms(this->integration_time_));
ESP_LOGCONFIG(TAG, " Measurement repeat rate: %d ms", get_meas_time_ms(this->repeat_rate_));
ESP_LOGCONFIG(TAG, " Glass attenuation factor: %f", this->glass_attenuation_factor_);
ESP_LOGCONFIG(TAG,
" Automatic mode: %s\n"
" Gain: %.0fx\n"
" Integration time: %d ms\n"
" Measurement repeat rate: %d ms\n"
" Glass attenuation factor: %f",
ONOFF(this->automatic_mode_enabled_), get_gain_coeff(this->gain_),
get_itime_ms(this->integration_time_), get_meas_time_ms(this->repeat_rate_),
this->glass_attenuation_factor_);
LOG_SENSOR(" ", "ALS calculated lux", this->ambient_light_sensor_);
LOG_SENSOR(" ", "CH1 Infrared counts", this->infrared_counts_sensor_);
LOG_SENSOR(" ", "CH0 Visible+IR counts", this->full_spectrum_counts_sensor_);
LOG_SENSOR(" ", "Actual gain", this->actual_gain_sensor_);
}
if (this->is_ps_()) {
ESP_LOGCONFIG(TAG, " Proximity gain: %.0fx", get_ps_gain_coeff(this->ps_gain_));
ESP_LOGCONFIG(TAG, " Proximity cooldown time: %d s", this->ps_cooldown_time_s_);
ESP_LOGCONFIG(TAG, " Proximity high threshold: %d", this->ps_threshold_high_);
ESP_LOGCONFIG(TAG, " Proximity low threshold: %d", this->ps_threshold_low_);
ESP_LOGCONFIG(TAG,
" Proximity gain: %.0fx\n"
" Proximity cooldown time: %d s\n"
" Proximity high threshold: %d\n"
" Proximity low threshold: %d",
get_ps_gain_coeff(this->ps_gain_), this->ps_cooldown_time_s_, this->ps_threshold_high_,
this->ps_threshold_low_);
LOG_SENSOR(" ", "Proximity counts", this->proximity_counts_sensor_);
}
LOG_UPDATE_INTERVAL(this);