From d89a29d4515a966065bccb28f0db66ba7dbe3e78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20Koek?= Date: Tue, 26 Mar 2024 15:50:18 +0000 Subject: [PATCH] Update lora.cpp --- esphome/components/lora/lora.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/esphome/components/lora/lora.cpp b/esphome/components/lora/lora.cpp index f99ff577c1..5ac508acb7 100644 --- a/esphome/components/lora/lora.cpp +++ b/esphome/components/lora/lora.cpp @@ -7,12 +7,13 @@ void Lora::update() { if (this->pin_aux_->digital_read()) { this->starting_to_check_ = 0; this->time_out_after_ = 0; - } - // it has taken too long to complete, error out! - if ((millis() - this->starting_to_check_) > this->time_out_after_) { - ESP_LOGD(TAG, "Timeout error! Resetting timers"); - this->starting_to_check_ = 0; - this->time_out_after_ = 0; + } else { + // it has taken too long to complete, error out! + if ((millis() - this->starting_to_check_) > this->time_out_after_) { + ESP_LOGD(TAG, "Timeout error! Resetting timers"); + this->starting_to_check_ = 0; + this->time_out_after_ = 0; + } } if (!this->update_needed_) return;