mirror of
https://github.com/esphome/esphome.git
synced 2025-08-07 19:07:45 +00:00
dry
This commit is contained in:
parent
f76ce5d3bb
commit
36d11c969f
@ -153,6 +153,14 @@ void ESP32TouchComponent::calculate_release_timeout_() {
|
|||||||
this->release_check_interval_ms_ = this->release_timeout_ms_ / 4;
|
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 esp32_touch
|
||||||
} // namespace esphome
|
} // namespace esphome
|
||||||
|
|
||||||
|
@ -137,16 +137,6 @@ void ESP32TouchComponent::setup() {
|
|||||||
|
|
||||||
// Calculate release timeout based on sleep cycle
|
// Calculate release timeout based on sleep cycle
|
||||||
this->calculate_release_timeout_();
|
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() {
|
void ESP32TouchComponent::dump_config() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user