diff --git a/esphome/nspanel_esphome_core.yaml b/esphome/nspanel_esphome_core.yaml index 9ca3a83..b2d104b 100644 --- a/esphome/nspanel_esphome_core.yaml +++ b/esphome/nspanel_esphome_core.yaml @@ -1706,19 +1706,19 @@ text_sensor: internal: false disabled_by_default: false lambda: |- - if (!${pre_built}) { - return {"${name}"}; - } else { - std::string suffix; - uint8_t mac[6] = {0,0,0,0,0,0}; - esp_read_mac(mac, ESP_MAC_WIFI_STA); - for (int i = 3; i < 6; ++i) { - char hex[3]; - snprintf(hex, sizeof(hex), "%02X", mac[i]); - suffix += hex; - } - return {"${name}" + "-" + suffix}; - } + #ifdef NSPANEL_HA_BLUEPRINT_PREBUILT + std::string suffix; + uint8_t mac[6] = {0,0,0,0,0,0}; + esp_read_mac(mac, ESP_MAC_WIFI_STA); + for (int i = 3; i < 6; ++i) { + char hex[3]; + snprintf(hex, sizeof(hex), "%02X", mac[i]); + suffix += hex; + } + return {"${name}" + "-" + suffix}; + #else + return {"${name}"}; + #endif filters: - lambda: |- std::string result;