This commit is contained in:
J. Nick Koston 2025-06-30 14:29:57 -05:00
parent f76ce5d3bb
commit 36d11c969f
No known key found for this signature in database
2 changed files with 8 additions and 10 deletions

View File

@ -153,6 +153,14 @@ void ESP32TouchComponent::calculate_release_timeout_() {
this->release_check_interval_ms_ = this->release_timeout_ms_ / 4;
}
void ESP32TouchComponent::initialize_tracking_arrays_() {
// Initialize tracking arrays
for (size_t i = 0; i < TOUCH_PAD_MAX; i++) {
this->last_touch_time_[i] = 0;
this->initial_state_published_[i] = false;
}
}
} // namespace esp32_touch
} // namespace esphome

View File

@ -137,16 +137,6 @@ void ESP32TouchComponent::setup() {
// Calculate release timeout based on sleep cycle
this->calculate_release_timeout_();
// Initialize tracking arrays
for (size_t i = 0; i < TOUCH_PAD_MAX; i++) {
this->last_touch_time_[i] = 0;
this->initial_state_published_[i] = false;
}
// Mark initial states as not published yet (like v1)
// The actual initial state will be determined after release_timeout_ms_ in the loop
// This prevents false positives during startup when values may be unstable
}
void ESP32TouchComponent::dump_config() {