mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-24 09:46:36 +00:00
Ensure computeStateName returns a string type (#17928)
This commit is contained in:
parent
22f9dbd65d
commit
362d950515
@ -7,7 +7,7 @@ export const computeStateNameFromEntityAttributes = (
|
||||
): string =>
|
||||
attributes.friendly_name === undefined
|
||||
? computeObjectId(entityId).replace(/_/g, " ")
|
||||
: attributes.friendly_name || "";
|
||||
: (attributes.friendly_name ?? "").toString();
|
||||
|
||||
export const computeStateName = (stateObj: HassEntity): string =>
|
||||
computeStateNameFromEntityAttributes(stateObj.entity_id, stateObj.attributes);
|
||||
|
Loading…
x
Reference in New Issue
Block a user