Update nspanel_esphome_core.yaml

try to make the device name respect name_add_mac_suffix
This commit is contained in:
MichaelHeimann
2024-04-03 18:28:20 +02:00
committed by GitHub
parent 235a5b2970
commit 2e802607bb

View File

@@ -1621,7 +1621,15 @@ text_sensor:
entity_category: diagnostic
internal: false
disabled_by_default: false
lambda: return {"${name}"};
lambda: |-
if !(${name_add_mac_suffix}) {
return {"${name}"};
} else {
byte mac[6];
WiFi.macAddress(mac);
String suffix = String(mac[3],HEX) + String(mac[4],HEX) + String(mac[5],HEX);
return {"${name}-" + suffix};
}
filters:
- lambda: |-
std::string result;