Update nspanel_esphome_core.yaml
This commit is contained in:
@@ -1709,11 +1709,15 @@ text_sensor:
|
||||
if (!${pre_built}) {
|
||||
return {"${name}"};
|
||||
} else {
|
||||
uint8_t mac[6] = {0};
|
||||
esp_err_t ret = ESP_OK;
|
||||
ret = esp_read_mac(mac, ESP_MAC_WIFI_STA);
|
||||
std::string suffix = std::string(mac[3],16) + std::string(mac[4],16) + std::string(mac[5],16);
|
||||
return {"${name}-" + suffix};
|
||||
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};
|
||||
}
|
||||
filters:
|
||||
- lambda: |-
|
||||
|
||||
Reference in New Issue
Block a user