diff --git a/esphome/components/ebyte_lora/ebyte_lora.cpp b/esphome/components/ebyte_lora/ebyte_lora.cpp index f7cb751399..2df63d6615 100644 --- a/esphome/components/ebyte_lora/ebyte_lora.cpp +++ b/esphome/components/ebyte_lora/ebyte_lora.cpp @@ -350,9 +350,8 @@ void EbyteLoraComponent::loop() { } if (data[0] == PROGRAM_CONF) { ESP_LOGD(TAG, "GOT PROGRAM_CONF"); - auto *sbuff = reinterpret_cast(&data); memset(&this->config, 0, sizeof(RegisterConfig)); - memcpy(&this->config, sbuff, sbuff->length); + memcpy(&this->config, &data[0], sizeof(RegisterConfig)); set_mode_(NORMAL); } }