mirror of
https://github.com/home-assistant/frontend.git
synced 2025-06-25 19:46:36 +00:00
12 lines
331 B
JavaScript
12 lines
331 B
JavaScript
import computeObjectId from './compute_object_id';
|
|
|
|
export default function computeStateName(stateObj) {
|
|
if (stateObj._entityDisplay === undefined) {
|
|
stateObj._entityDisplay = (
|
|
stateObj.attributes.friendly_name ||
|
|
computeObjectId(stateObj.entity_id).replace(/_/g, ' '));
|
|
}
|
|
|
|
return stateObj._entityDisplay;
|
|
}
|