mirror of
https://github.com/esphome/esphome.git
synced 2025-10-06 20:03:46 +01:00
Reduce number of calls to fetch time in the main loop (#8804)
This commit is contained in:
@@ -288,7 +288,7 @@ uint32_t ESP32TouchComponent::component_touch_pad_read(touch_pad_t tp) {
|
||||
}
|
||||
|
||||
void ESP32TouchComponent::loop() {
|
||||
const uint32_t now = millis();
|
||||
const uint32_t now = App.get_loop_component_start_time();
|
||||
bool should_print = this->setup_mode_ && now - this->setup_mode_last_log_print_ > 250;
|
||||
for (auto *child : this->children_) {
|
||||
child->value_ = this->component_touch_pad_read(child->get_touch_pad());
|
||||
|
Reference in New Issue
Block a user