mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-23 09:16:38 +00:00
Format "IP" and "MAC" attribute names (#9034)
This commit is contained in:
parent
debcdefc21
commit
0562242043
@ -122,6 +122,10 @@ export default hassAttributeUtil;
|
||||
|
||||
// Convert from internal snake_case format to user-friendly format
|
||||
export function formatAttributeName(value: string): string {
|
||||
value = value.replace(/_/g, " ").replace(/\bid\b/g, "ID");
|
||||
value = value
|
||||
.replace(/_/g, " ")
|
||||
.replace(/\bid\b/g, "ID")
|
||||
.replace(/\bip\b/g, "IP")
|
||||
.replace(/\bmac\b/g, "MAC");
|
||||
return value.charAt(0).toUpperCase() + value.slice(1);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user