1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-02 10:02:23 +01:00
This commit is contained in:
J. Nick Koston
2025-06-30 14:32:13 -05:00
parent 71aff9bc60
commit e36c669dc0
2 changed files with 2 additions and 8 deletions

View File

@@ -132,10 +132,7 @@ void ESP32TouchComponent::loop() {
// Handle initial state publication after startup // Handle initial state publication after startup
this->publish_initial_state_if_needed_(child, now); this->publish_initial_state_if_needed_(child, now);
if (!this->initial_state_published_[pad]) { if (child->last_state_) {
// Not yet published, don't count as off
continue;
} else if (child->last_state_) {
// Pad is currently in touched state - check for release timeout // Pad is currently in touched state - check for release timeout
// Using subtraction handles 32-bit rollover correctly // Using subtraction handles 32-bit rollover correctly
uint32_t time_diff = now - this->last_touch_time_[pad]; uint32_t time_diff = now - this->last_touch_time_[pad];

View File

@@ -316,10 +316,7 @@ void ESP32TouchComponent::loop() {
// Handle initial state publication after startup // Handle initial state publication after startup
this->publish_initial_state_if_needed_(child, now); this->publish_initial_state_if_needed_(child, now);
if (!this->initial_state_published_[pad]) { if (child->last_state_) {
// Not yet published, don't count as off
continue;
} else if (child->last_state_) {
// Pad is currently in touched state - check for release timeout // Pad is currently in touched state - check for release timeout
// Using subtraction handles 32-bit rollover correctly // Using subtraction handles 32-bit rollover correctly
uint32_t time_diff = now - this->last_touch_time_[pad]; uint32_t time_diff = now - this->last_touch_time_[pad];