Reduce number of calls to fetch time in the main loop (#8804)

This commit is contained in:
J. Nick Koston
2025-05-19 07:48:57 +12:00
committed by GitHub
parent e47741d471
commit 574aabdede
36 changed files with 107 additions and 53 deletions
@@ -1,6 +1,7 @@
#include "time_based_cover.h"
#include "esphome/core/log.h"
#include "esphome/core/hal.h"
#include "esphome/core/application.h"
namespace esphome {
namespace time_based {
@@ -26,7 +27,7 @@ void TimeBasedCover::loop() {
if (this->current_operation == COVER_OPERATION_IDLE)
return;
const uint32_t now = millis();
const uint32_t now = App.get_loop_component_start_time();
// Recompute position every loop cycle
this->recompute_position_();