mirror of
https://github.com/esphome/esphome.git
synced 2025-10-01 17:42:22 +01:00
[wifi] Use custom MAC address if programmed (#7498)
This commit is contained in:
@@ -130,11 +130,16 @@ void event_handler(void *arg, esp_event_base_t event_base, int32_t event_id, voi
|
||||
}
|
||||
|
||||
void WiFiComponent::wifi_pre_setup_() {
|
||||
#ifdef USE_ESP32_IGNORE_EFUSE_MAC_CRC
|
||||
uint8_t mac[6];
|
||||
#ifdef USE_ESP32_IGNORE_EFUSE_MAC_CRC
|
||||
get_mac_address_raw(mac);
|
||||
set_mac_address(mac);
|
||||
ESP_LOGV(TAG, "Use EFuse MAC without checking CRC: %s", get_mac_address_pretty().c_str());
|
||||
#else
|
||||
if (has_custom_mac_address()) {
|
||||
get_mac_address_raw(mac);
|
||||
set_mac_address(mac);
|
||||
}
|
||||
#endif
|
||||
esp_err_t err = esp_netif_init();
|
||||
if (err != ERR_OK) {
|
||||
|
Reference in New Issue
Block a user