From 8989c307d89f5b6c34ac378ef4c96b780c64458c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20Koek?= Date: Fri, 11 Oct 2024 09:48:01 +0100 Subject: [PATCH] Update ebyte_lora_component.cpp --- esphome/components/ebyte_lora/ebyte_lora_component.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/esphome/components/ebyte_lora/ebyte_lora_component.cpp b/esphome/components/ebyte_lora/ebyte_lora_component.cpp index 199fe3cd93..f095174a5b 100644 --- a/esphome/components/ebyte_lora/ebyte_lora_component.cpp +++ b/esphome/components/ebyte_lora/ebyte_lora_component.cpp @@ -301,7 +301,6 @@ void EbyteLoraComponent::get_current_config_() { if (this->get_mode_() != CONFIGURATION) { ESP_LOGD(TAG, "Mode not set right requesting that and returning %u", this->get_mode_()); this->set_mode_(CONFIGURATION); - return; } if (this->can_send_message_("get_current_config_")) { uint8_t data[3] = {PROGRAM_CONF, 0x00, 0x08}; @@ -408,7 +407,8 @@ void EbyteLoraComponent::update() { } } } - if (this->config_mode_ != NORMAL) { + // only make it normal when config is set + if (this->current_config_.config_set != 0 && this->config_mode_ != NORMAL) { this->config_mode_ = this->get_mode_(); if (this->config_mode_ != NORMAL) { @@ -504,7 +504,6 @@ void EbyteLoraComponent::process_(std::vector data) { if (data.size() - i < sensor_name_length) { return ESP_LOGV(TAG, "Name length of %u not available", sensor_name_length); } - // get the memory cleared and set memset(sensor_name, 0, sizeof sensor_name); for (size_t s = 0; s < sensor_name_length; s++) {