mirror of
https://github.com/esphome/esphome.git
synced 2025-01-08 13:51:43 +01:00
Update ebyte_lora_component.cpp
This commit is contained in:
parent
846dea459e
commit
3148a17b9b
1 changed files with 4 additions and 3 deletions
|
@ -300,11 +300,10 @@ void EbyteLoraComponent::setup() {
|
||||||
}
|
}
|
||||||
void EbyteLoraComponent::request_current_config_() {
|
void EbyteLoraComponent::request_current_config_() {
|
||||||
if (this->get_mode_() != CONFIGURATION) {
|
if (this->get_mode_() != CONFIGURATION) {
|
||||||
ESP_LOGD(TAG, "Mode not set right requesting that and returning %u", this->get_mode_());
|
ESP_LOGD(TAG, "Mode not set right, setting it to wat we got");
|
||||||
this->set_mode_(CONFIGURATION);
|
this->set_mode_(this->get_mode_());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// if (this->can_send_message_("get_current_config_")) {
|
|
||||||
uint8_t data[3] = {PROGRAM_CONF, 0x00, 0x08};
|
uint8_t data[3] = {PROGRAM_CONF, 0x00, 0x08};
|
||||||
this->write_array(data, sizeof(data));
|
this->write_array(data, sizeof(data));
|
||||||
ESP_LOGD(TAG, "Config info requested");
|
ESP_LOGD(TAG, "Config info requested");
|
||||||
|
@ -378,6 +377,8 @@ void EbyteLoraComponent::update() {
|
||||||
if (millis() < this->busy_till_)
|
if (millis() < this->busy_till_)
|
||||||
return;
|
return;
|
||||||
if (!this->current_config_.config_set) {
|
if (!this->current_config_.config_set) {
|
||||||
|
this->set_mode_(CONFIGURATION);
|
||||||
|
delay(5);
|
||||||
ESP_LOGD(TAG, "Config not set yet! Requesting");
|
ESP_LOGD(TAG, "Config not set yet! Requesting");
|
||||||
this->request_current_config_();
|
this->request_current_config_();
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in a new issue