mirror of
https://github.com/home-assistant/frontend.git
synced 2025-08-02 14:07:55 +00:00
Allow empty name (#2388)
This commit is contained in:
parent
f272801253
commit
25c788871f
@ -2,5 +2,6 @@ import { HassEntity } from "home-assistant-js-websocket";
|
|||||||
import computeObjectId from "./compute_object_id";
|
import computeObjectId from "./compute_object_id";
|
||||||
|
|
||||||
export default (stateObj: HassEntity): string =>
|
export default (stateObj: HassEntity): string =>
|
||||||
stateObj.attributes.friendly_name ||
|
stateObj.attributes.friendly_name === undefined
|
||||||
computeObjectId(stateObj.entity_id).replace(/_/g, " ");
|
? computeObjectId(stateObj.entity_id).replace(/_/g, " ")
|
||||||
|
: stateObj.attributes.friendly_name || "";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user