Reduce number of calls to fetch time in the main loop (#8804)
This commit is contained in:
1 parent
e47741d471
commit
574aabdede
36 files changed
+107
-53
No files matched your search
@@ -1,6 +1,7 @@
|
||||
#include "current_based_cover.h"
|
||||
#include "esphome/core/hal.h"
|
||||
#include "esphome/core/log.h"
|
||||
#include "esphome/core/application.h"
|
||||
#include <cfloat>
|
||||
|
||||
namespace esphome {
|
||||
@@ -60,7 +61,7 @@ void CurrentBasedCover::loop() {
|
||||
if (this->current_operation == COVER_OPERATION_IDLE)
|
||||
return;
|
||||
|
||||
const uint32_t now = millis();
|
||||
const uint32_t now = App.get_loop_component_start_time();
|
||||
|
||||
if (this->current_operation == COVER_OPERATION_OPENING) {
|
||||
if (this->malfunction_detection_ && this->is_closing_()) { // Malfunction
|
||||
|
||||
Reference in new issue
Block a user