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