From 362d950515c07e957123304cb8a614b1aa87a47a Mon Sep 17 00:00:00 2001 From: karwosts <32912880+karwosts@users.noreply.github.com> Date: Mon, 25 Sep 2023 09:11:02 -0700 Subject: [PATCH] Ensure computeStateName returns a string type (#17928) --- src/common/entity/compute_state_name.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/entity/compute_state_name.ts b/src/common/entity/compute_state_name.ts index 2311830a9c..dc599caa0a 100644 --- a/src/common/entity/compute_state_name.ts +++ b/src/common/entity/compute_state_name.ts @@ -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);