Update ebyte_lora_component.cpp

This commit is contained in:
Daniël Koek 2024-10-16 14:20:39 +01:00
parent 4ef9cd7605
commit b3b1751e98

View file

@ -392,7 +392,8 @@ void EbyteLoraComponent::update() {
if (millis() < this->busy_till_)
return;
if (!this->current_config_.config_set) {
this->set_mode_(CONFIGURATION);
if (this->get_mode_() != CONFIGURATION)
this->set_mode_(CONFIGURATION);
delay(20);
ESP_LOGD(TAG, "Config not set yet! Requesting");
this->request_current_config_();
@ -403,16 +404,6 @@ void EbyteLoraComponent::update() {
this->set_config_();
return;
}
// only make it normal when config is set
if (this->current_mode_ != NORMAL) {
ESP_LOGD(TAG, "Current mode is not normal");
this->current_mode_ = this->get_mode_();
if (this->current_mode_ != NORMAL) {
ESP_LOGD(TAG, "Mode is not set right");
this->set_mode_(NORMAL);
}
}
auto now = millis() / 1000;
if (this->last_key_time_ + this->recyle_time_ < now) {
ESP_LOGD(TAG, "Requesting all systems to send new info ");