mirror of
https://github.com/esphome/esphome.git
synced 2026-01-10 04:00:51 -07:00
[shelly_dimmer] Combine log statements to reduce loop blocking (#12956)
This commit is contained in:
@@ -113,26 +113,20 @@ void ShellyDimmer::setup() {
|
||||
void ShellyDimmer::update() { this->send_command_(SHELLY_DIMMER_PROTO_CMD_POLL, nullptr, 0); }
|
||||
|
||||
void ShellyDimmer::dump_config() {
|
||||
ESP_LOGCONFIG(TAG, "ShellyDimmer:");
|
||||
LOG_PIN(" NRST Pin: ", this->pin_nrst_);
|
||||
LOG_PIN(" BOOT0 Pin: ", this->pin_boot0_);
|
||||
|
||||
ESP_LOGCONFIG(TAG,
|
||||
"ShellyDimmer:\n"
|
||||
" Leading Edge: %s\n"
|
||||
" Warmup Brightness: %d\n"
|
||||
" Minimum Brightness: %d\n"
|
||||
" Maximum Brightness: %d",
|
||||
YESNO(this->leading_edge_), this->warmup_brightness_, this->min_brightness_, this->max_brightness_);
|
||||
// ESP_LOGCONFIG(TAG, " Warmup Time: %d", this->warmup_time_);
|
||||
// ESP_LOGCONFIG(TAG, " Fade Rate: %d", this->fade_rate_);
|
||||
|
||||
LOG_UPDATE_INTERVAL(this);
|
||||
|
||||
ESP_LOGCONFIG(TAG,
|
||||
" STM32 current firmware version: %d.%d \n"
|
||||
" Maximum Brightness: %d\n"
|
||||
" STM32 current firmware version: %d.%d\n"
|
||||
" STM32 required firmware version: %d.%d",
|
||||
YESNO(this->leading_edge_), this->warmup_brightness_, this->min_brightness_, this->max_brightness_,
|
||||
this->version_major_, this->version_minor_, USE_SHD_FIRMWARE_MAJOR_VERSION,
|
||||
USE_SHD_FIRMWARE_MINOR_VERSION);
|
||||
LOG_PIN(" NRST Pin: ", this->pin_nrst_);
|
||||
LOG_PIN(" BOOT0 Pin: ", this->pin_boot0_);
|
||||
LOG_UPDATE_INTERVAL(this);
|
||||
|
||||
if (this->version_major_ != USE_SHD_FIRMWARE_MAJOR_VERSION ||
|
||||
this->version_minor_ != USE_SHD_FIRMWARE_MINOR_VERSION) {
|
||||
@@ -439,13 +433,15 @@ bool ShellyDimmer::handle_frame_() {
|
||||
current = CURRENT_SCALING_FACTOR / static_cast<float>(current_raw);
|
||||
}
|
||||
|
||||
ESP_LOGI(TAG, "Got dimmer data:");
|
||||
ESP_LOGI(TAG, " HW version: %d", hw_version);
|
||||
ESP_LOGI(TAG, " Brightness: %d", brightness);
|
||||
ESP_LOGI(TAG, " Fade rate: %d", fade_rate);
|
||||
ESP_LOGI(TAG, " Power: %f W", power);
|
||||
ESP_LOGI(TAG, " Voltage: %f V", voltage);
|
||||
ESP_LOGI(TAG, " Current: %f A", current);
|
||||
ESP_LOGI(TAG,
|
||||
"Got dimmer data:\n"
|
||||
" HW version: %d\n"
|
||||
" Brightness: %d\n"
|
||||
" Fade rate: %d\n"
|
||||
" Power: %f W\n"
|
||||
" Voltage: %f V\n"
|
||||
" Current: %f A",
|
||||
hw_version, brightness, fade_rate, power, voltage, current);
|
||||
|
||||
// Update sensors.
|
||||
if (this->power_sensor_ != nullptr) {
|
||||
|
||||
Reference in New Issue
Block a user