mirror of
https://github.com/esphome/esphome.git
synced 2025-10-12 14:53:49 +01:00
Reduce CPU overhead by allowing components to disable their loop() (#9089)
This commit is contained in:
@@ -67,6 +67,12 @@ void SNTPComponent::loop() {
|
||||
time.minute, time.second);
|
||||
this->time_sync_callback_.call();
|
||||
this->has_time_ = true;
|
||||
|
||||
#ifdef USE_ESP_IDF
|
||||
// On ESP-IDF, time sync is permanent and update() doesn't force resync
|
||||
// Time is now synchronized, no need to check anymore
|
||||
this->disable_loop();
|
||||
#endif
|
||||
}
|
||||
|
||||
} // namespace sntp
|
||||
|
Reference in New Issue
Block a user