mirror of
https://github.com/esphome/esphome.git
synced 2026-09-03 19:46:02 +00:00
Downgrade select and switch control path logging from DEBUG to VERBOSE
The ESP_LOGD calls in SelectCall::perform() and Switch::turn_on/turn_off/toggle are redundant with aioesphomeapi's state_log_formatter which already logs both commands and state changes on the HA side. Benchmarks show these ESP_LOGD calls dominate the control path cost (~13M ops/s for SelectCall vs ~180M ops/s for publish_state). This aligns select and switch with climate and fan which already use ESP_LOGV for their call perform() paths.
This commit is contained in:
@@ -116,7 +116,7 @@ void SelectCall::perform() {
|
||||
|
||||
auto idx = target_index.value();
|
||||
// All operations use indices, call control() by index to avoid string conversion
|
||||
ESP_LOGD(TAG, "'%s' - Set selected option to: %s", name, parent->option_at(idx));
|
||||
ESP_LOGV(TAG, "'%s' - Set selected option to: %s", name, parent->option_at(idx));
|
||||
parent->control(idx);
|
||||
}
|
||||
|
||||
|
||||
@@ -18,15 +18,15 @@ void Switch::control(bool target_state) {
|
||||
}
|
||||
}
|
||||
void Switch::turn_on() {
|
||||
ESP_LOGD(TAG, "'%s' Turning ON.", this->get_name().c_str());
|
||||
ESP_LOGV(TAG, "'%s' Turning ON.", this->get_name().c_str());
|
||||
this->write_state(!this->inverted_);
|
||||
}
|
||||
void Switch::turn_off() {
|
||||
ESP_LOGD(TAG, "'%s' Turning OFF.", this->get_name().c_str());
|
||||
ESP_LOGV(TAG, "'%s' Turning OFF.", this->get_name().c_str());
|
||||
this->write_state(this->inverted_);
|
||||
}
|
||||
void Switch::toggle() {
|
||||
ESP_LOGD(TAG, "'%s' Toggling %s.", this->get_name().c_str(), this->state ? "OFF" : "ON");
|
||||
ESP_LOGV(TAG, "'%s' Toggling %s.", this->get_name().c_str(), this->state ? "OFF" : "ON");
|
||||
this->write_state(this->inverted_ == this->state);
|
||||
}
|
||||
optional<bool> Switch::get_initial_state() {
|
||||
|
||||
Reference in New Issue
Block a user