[hlw8012] Combine log statements to reduce loop blocking (#12901)

This commit is contained in:
J. Nick Koston
2026-01-04 11:51:45 -10:00
committed by GitHub
parent 9b2a36a313
commit 8ae1f26b6a

View File

@@ -33,15 +33,15 @@ void HLW8012Component::setup() {
}
}
void HLW8012Component::dump_config() {
ESP_LOGCONFIG(TAG, "HLW8012:");
LOG_PIN(" SEL Pin: ", this->sel_pin_);
LOG_PIN(" CF Pin: ", this->cf_pin_);
LOG_PIN(" CF1 Pin: ", this->cf1_pin_);
ESP_LOGCONFIG(TAG,
"HLW8012:\n"
" Change measurement mode every %" PRIu32 "\n"
" Current resistor: %.1f mΩ\n"
" Voltage Divider: %.1f",
this->change_mode_every_, this->current_resistor_ * 1000.0f, this->voltage_divider_);
LOG_PIN(" SEL Pin: ", this->sel_pin_);
LOG_PIN(" CF Pin: ", this->cf_pin_);
LOG_PIN(" CF1 Pin: ", this->cf1_pin_);
LOG_UPDATE_INTERVAL(this);
LOG_SENSOR(" ", "Voltage", this->voltage_sensor_);
LOG_SENSOR(" ", "Current", this->current_sensor_);