From 3d4e589bcbc75c3502e60e55653415efc1cc7c6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20Koek?= Date: Mon, 25 Mar 2024 16:37:30 +0000 Subject: [PATCH] Update lora.cpp --- esphome/components/lora/lora.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/esphome/components/lora/lora.cpp b/esphome/components/lora/lora.cpp index 238d449f73..7a07b65c1f 100644 --- a/esphome/components/lora/lora.cpp +++ b/esphome/components/lora/lora.cpp @@ -97,7 +97,7 @@ bool Lora::wait_complete_response_(uint32_t timeout, uint32_t wait_no_aux) { if ((t + timeout) == 0) { t = 0; } - + ESP_LOGD(TAG, "Checking if response was complete"); // if AUX pin was supplied and look for HIGH state // note you can omit using AUX if no pins are available, but you will have to use delay() to let module finish if (this->pin_aux_ != nullptr) { @@ -135,8 +135,9 @@ bool Lora::send_pin_info_(uint8_t pin, bool value) { ESP_LOGD(TAG, "PIN: %u ", data[1]); ESP_LOGD(TAG, "VALUE: %u ", data[2]); this->write_array(data, sizeof(data)); - // bool result = this->waitCompleteResponse(5000, 5000); - return true; + bool return_value = this->wait_complete_response_(5000, 5000); + this->flush(); + return return_value; } void Lora::loop() { std::string buffer;