Update nspanel_esphome_core.yaml
try to make the device name respect name_add_mac_suffix
This commit is contained in:
@@ -1621,7 +1621,15 @@ text_sensor:
|
|||||||
entity_category: diagnostic
|
entity_category: diagnostic
|
||||||
internal: false
|
internal: false
|
||||||
disabled_by_default: 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:
|
filters:
|
||||||
- lambda: |-
|
- lambda: |-
|
||||||
std::string result;
|
std::string result;
|
||||||
|
|||||||
Reference in New Issue
Block a user