1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-16 10:12:21 +01:00
This commit is contained in:
J. Nick Koston
2025-06-12 15:47:31 -05:00
parent e83f4ae974
commit bbf7d32676

View File

@@ -296,7 +296,8 @@ void ESP32TouchComponent::loop() {
// Find the child for the pad that triggered the interrupt
for (auto *child : this->children_) {
if (child->get_touch_pad() == event.pad an && d child->last_state_ != is_touch_event) {
if (child->get_touch_pad() == event.pad)
if (child->last_state_ != is_touch_event) {
// Read current value
uint32_t value = 0;
if (this->filter_configured_()) {
@@ -309,6 +310,7 @@ void ESP32TouchComponent::loop() {
child->publish_state(is_touch_event);
ESP_LOGD(TAG, "Touch Pad '%s' %s (value: %d, threshold: %d)", child->get_name().c_str(),
is_touch_event ? "touched" : "released", value, child->get_threshold());
}
break;
}
}
@@ -327,8 +329,8 @@ void ESP32TouchComponent::loop() {
if (this->filter_configured_()) {
touch_pad_filter_read_smooth(child->get_touch_pad(), &smooth);
ESP_LOGD(TAG, " Pad T%d: raw=%d, benchmark=%d, smooth=%d, threshold=%d", child->get_touch_pad(), raw,
benchmark, smooth, child->get_threshold());
ESP_LOGD(TAG, " Pad T%d: raw=%d, benchmark=%d, smooth=%d, threshold=%d", child->get_touch_pad(), raw, benchmark,
smooth, child->get_threshold());
} else {
ESP_LOGD(TAG, " Pad T%d: raw=%d, benchmark=%d, threshold=%d", child->get_touch_pad(), raw, benchmark,
child->get_threshold());