1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-26 12:43:48 +00: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

@@ -346,10 +346,12 @@ size_t ModbusController::create_register_ranges_() {
}
void ModbusController::dump_config() {
ESP_LOGCONFIG(TAG, "ModbusController:");
ESP_LOGCONFIG(TAG, " Address: 0x%02X", this->address_);
ESP_LOGCONFIG(TAG, " Max Command Retries: %d", this->max_cmd_retries_);
ESP_LOGCONFIG(TAG, " Offline Skip Updates: %d", this->offline_skip_updates_);
ESP_LOGCONFIG(TAG,
"ModbusController:\n"
" Address: 0x%02X\n"
" Max Command Retries: %d\n"
" Offline Skip Updates: %d",
this->address_, this->max_cmd_retries_, this->offline_skip_updates_);
#if ESPHOME_LOG_LEVEL >= ESPHOME_LOG_LEVEL_VERBOSE
ESP_LOGCONFIG(TAG, "sensormap");
for (auto &it : this->sensorset_) {

View File

@@ -52,9 +52,11 @@ void ModbusFloatOutput::write_state(float value) {
void ModbusFloatOutput::dump_config() {
ESP_LOGCONFIG(TAG, "Modbus Float Output:");
LOG_FLOAT_OUTPUT(this);
ESP_LOGCONFIG(TAG, " Device start address: 0x%X", this->start_address);
ESP_LOGCONFIG(TAG, " Register count: %d", this->register_count);
ESP_LOGCONFIG(TAG, " Value type: %d", static_cast<int>(this->sensor_value_type));
ESP_LOGCONFIG(TAG,
" Device start address: 0x%X\n"
" Register count: %d\n"
" Value type: %d",
this->start_address, this->register_count, static_cast<int>(this->sensor_value_type));
}
// ModbusBinaryOutput
@@ -102,9 +104,11 @@ void ModbusBinaryOutput::write_state(bool state) {
void ModbusBinaryOutput::dump_config() {
ESP_LOGCONFIG(TAG, "Modbus Binary Output:");
LOG_BINARY_OUTPUT(this);
ESP_LOGCONFIG(TAG, " Device start address: 0x%X", this->start_address);
ESP_LOGCONFIG(TAG, " Register count: %d", this->register_count);
ESP_LOGCONFIG(TAG, " Value type: %d", static_cast<int>(this->sensor_value_type));
ESP_LOGCONFIG(TAG,
" Device start address: 0x%X\n"
" Register count: %d\n"
" Value type: %d",
this->start_address, this->register_count, static_cast<int>(this->sensor_value_type));
}
} // namespace modbus_controller