mirror of
https://github.com/esphome/esphome.git
synced 2026-06-01 17:57:37 +08:00
[safe_mode] Use loop component start time instead of millis() (#15591)
This commit is contained in:
@@ -86,7 +86,8 @@ void SafeModeComponent::mark_successful() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void SafeModeComponent::loop() {
|
void SafeModeComponent::loop() {
|
||||||
if (!this->boot_successful_ && (millis() - this->safe_mode_start_time_) > this->safe_mode_boot_is_good_after_) {
|
if (!this->boot_successful_ &&
|
||||||
|
(App.get_loop_component_start_time() - this->safe_mode_start_time_) > this->safe_mode_boot_is_good_after_) {
|
||||||
// successful boot, reset counter
|
// successful boot, reset counter
|
||||||
ESP_LOGI(TAG, "Boot seems successful; resetting boot loop counter");
|
ESP_LOGI(TAG, "Boot seems successful; resetting boot loop counter");
|
||||||
this->mark_successful();
|
this->mark_successful();
|
||||||
|
|||||||
Reference in New Issue
Block a user