From e7dd59558244da0bd12c78144df0ff4d04b18c17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20Koek?= Date: Fri, 11 Oct 2024 11:20:56 +0100 Subject: [PATCH] Update ebyte_lora_component.cpp --- .../components/ebyte_lora/ebyte_lora_component.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/esphome/components/ebyte_lora/ebyte_lora_component.cpp b/esphome/components/ebyte_lora/ebyte_lora_component.cpp index 6afb9f606d..f9d6e5cad8 100644 --- a/esphome/components/ebyte_lora/ebyte_lora_component.cpp +++ b/esphome/components/ebyte_lora/ebyte_lora_component.cpp @@ -542,6 +542,10 @@ void EbyteLoraComponent::process_(std::vector data) { } }; void EbyteLoraComponent::send_data_(bool all) { + if (this->get_mode_() != NORMAL) { + ESP_LOGD(TAG, "request_repeater_info_ needs normal mode to operate"); + this->set_mode_(NORMAL); + } if (!this->can_send_message_("send_data_")) return; // straight away we are all good for the next cycle @@ -594,6 +598,10 @@ void EbyteLoraComponent::send_repeater_info_() { this->write_array(data, sizeof(data)); } void EbyteLoraComponent::request_repeater_info_() { + if (this->get_mode_() != NORMAL) { + ESP_LOGD(TAG, "request_repeater_info_ needs normal mode to operate"); + this->set_mode_(NORMAL); + } if (!this->can_send_message_("request_repeater_info_")) return; this->request_repeater_info_update_needed_ = false; @@ -604,6 +612,10 @@ void EbyteLoraComponent::request_repeater_info_() { this->write_array(data, sizeof(data)); } void EbyteLoraComponent::repeat_message_(std::vector data) { + if (this->get_mode_() != NORMAL) { + ESP_LOGD(TAG, "request_repeater_info_ needs normal mode to operate"); + this->set_mode_(NORMAL); + } ESP_LOGD(TAG, "Got some info that i need to repeat for network %u", data[1]); if (!this->can_send_message_("repeat_message_")) return;