From 05622420439de10dba5f94f96dcfc22a8f2624de Mon Sep 17 00:00:00 2001 From: Philip Allgaier Date: Thu, 29 Apr 2021 15:55:51 +0200 Subject: [PATCH] Format "IP" and "MAC" attribute names (#9034) --- src/util/hass-attributes-util.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/util/hass-attributes-util.ts b/src/util/hass-attributes-util.ts index 95bfee3e96..0db6b5e0d5 100644 --- a/src/util/hass-attributes-util.ts +++ b/src/util/hass-attributes-util.ts @@ -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); }