From c77f45f4f272ec92e269afff027265c353204df0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20Koek?= Date: Fri, 11 Oct 2024 10:54:17 +0100 Subject: [PATCH] Update ebyte_lora_component.cpp --- .../ebyte_lora/ebyte_lora_component.cpp | 25 +++++++++---------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/esphome/components/ebyte_lora/ebyte_lora_component.cpp b/esphome/components/ebyte_lora/ebyte_lora_component.cpp index 4507028f37..1830887961 100644 --- a/esphome/components/ebyte_lora/ebyte_lora_component.cpp +++ b/esphome/components/ebyte_lora/ebyte_lora_component.cpp @@ -422,21 +422,20 @@ void EbyteLoraComponent::update() { } } void EbyteLoraComponent::loop() { - std::vector data; - if (!this->available()) - return; - ESP_LOGD(TAG, "Reading serial"); - while (this->available()) { - uint8_t c; - this->read_byte(&c); - data.push_back(c); + if (this->available()) { + std::vector data; + ESP_LOGD(TAG, "Reading serial"); + while (this->available()) { + uint8_t c; + this->read_byte(&c); + data.push_back(c); + } + if (this->repeater_enabled_) { + this->repeat_message_(data); + } + this->process_(data); } - if (this->repeater_enabled_) { - this->repeat_message_(data); - } - this->process_(data); - if (this->resend_repeater_request_) this->request_repeater_info_(); if (this->updated_) {