From b0bf6355c124edc58c088e3bd14694d3ffd4fc9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20Koek?= Date: Tue, 26 Mar 2024 16:37:46 +0000 Subject: [PATCH] maybe? --- esphome/components/lora/lora.cpp | 3 ++- esphome/components/lora/lora.h | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/esphome/components/lora/lora.cpp b/esphome/components/lora/lora.cpp index c69c45d590..5609fa41d8 100644 --- a/esphome/components/lora/lora.cpp +++ b/esphome/components/lora/lora.cpp @@ -5,6 +5,7 @@ namespace lora { void Lora::update() { can_send_message_(); get_mode_(); + check_for_message_(); if (!this->update_needed_) return; if (this->rssi_sensor_ != nullptr) @@ -145,7 +146,7 @@ void Lora::send_pin_info_(uint8_t pin, bool value) { this->setup_wait_response_(5000); ESP_LOGD(TAG, "Successfully put in queue"); } -void Lora::loop() { +void Lora::check_for_message_() { std::string buffer; std::vector data; bool pin_data_found = false; diff --git a/esphome/components/lora/lora.h b/esphome/components/lora/lora.h index 0fb0a8b1e8..6dd580a9e5 100644 --- a/esphome/components/lora/lora.h +++ b/esphome/components/lora/lora.h @@ -31,7 +31,7 @@ class Lora : public PollingComponent, public uart::UARTDevice { void setup() override; float get_setup_priority() const override { return setup_priority::HARDWARE; } void update() override; - void loop() override; + void dump_config() override; /// Helper function to write the value of a pin. void digital_write(uint8_t pin, bool value); @@ -45,6 +45,7 @@ class Lora : public PollingComponent, public uart::UARTDevice { ModeType mode_ = MODE_INIT; // set WOR mode void set_mode_(ModeType mode); + void check_for_message_(); ModeType get_mode_(); // checks the aux port to see if it is done setting void setup_wait_response_(uint32_t timeout = 1000);