mirror of
https://github.com/esphome/esphome.git
synced 2026-10-07 19:44:08 +00:00
[libretiny] Flag the LN882H SDK default MAC (#20175)
This commit is contained in:
@@ -2,6 +2,9 @@
|
||||
|
||||
#ifdef USE_LIBRETINY
|
||||
|
||||
#include <cstring>
|
||||
|
||||
#include "esphome/core/helpers.h"
|
||||
#include "esphome/core/log.h"
|
||||
|
||||
namespace esphome::libretiny {
|
||||
@@ -18,6 +21,17 @@ void LTComponent::dump_config() {
|
||||
ESP_LOGCONFIG(TAG, " Optimization: -Os, SDK: -O" STRINGIFY_MACRO(__OPTIMIZE_LEVEL__));
|
||||
#endif
|
||||
|
||||
#if defined(USE_LN882X) && defined(USE_WIFI)
|
||||
// The SDK falls back to this MAC when the board layout's KV store holds none.
|
||||
static constexpr uint8_t SDK_DEFAULT_MAC[MAC_ADDRESS_SIZE] = {0x00, 0x50, 0xC2, 0x5E, 0x10, 0x88};
|
||||
uint8_t mac[MAC_ADDRESS_SIZE];
|
||||
get_mac_address_raw(mac);
|
||||
if (memcmp(mac, SDK_DEFAULT_MAC, MAC_ADDRESS_SIZE) == 0) {
|
||||
ESP_LOGE(TAG, "MAC is the LN882H SDK default 00:50:C2:5E:10:88; only one device with it can be on a network. "
|
||||
"On a Tuya module, set board: to its Tuya board (e.g. wl2s, wl2h-u) and flash over serial");
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef USE_TEXT_SENSOR
|
||||
if (this->version_ != nullptr) {
|
||||
this->version_->publish_state(<_BANNER_STR[10]);
|
||||
|
||||
Reference in New Issue
Block a user