mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-25 18:26:35 +00:00
Fallback to state name when the entry doesn't have name (#24805)
This commit is contained in:
parent
750c59399b
commit
f06a0fa34c
@ -33,7 +33,14 @@ export const computeEntityEntryName = (
|
|||||||
const device = entry.device_id ? hass.devices[entry.device_id] : undefined;
|
const device = entry.device_id ? hass.devices[entry.device_id] : undefined;
|
||||||
|
|
||||||
if (!device) {
|
if (!device) {
|
||||||
return name;
|
if (name) {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
const stateObj = hass.states[entry.entity_id] as HassEntity | undefined;
|
||||||
|
if (stateObj) {
|
||||||
|
return computeStateName(stateObj);
|
||||||
|
}
|
||||||
|
return undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
const deviceName = computeDeviceName(device);
|
const deviceName = computeDeviceName(device);
|
||||||
|
@ -319,7 +319,7 @@ export class MoreInfoDialog extends LitElement {
|
|||||||
const breadcrumb = [areaName, deviceName, entityName].filter(
|
const breadcrumb = [areaName, deviceName, entityName].filter(
|
||||||
(v): v is string => Boolean(v)
|
(v): v is string => Boolean(v)
|
||||||
);
|
);
|
||||||
const title = this._childView?.viewTitle || breadcrumb.pop();
|
const title = this._childView?.viewTitle || breadcrumb.pop() || entityId;
|
||||||
|
|
||||||
return html`
|
return html`
|
||||||
<ha-dialog
|
<ha-dialog
|
||||||
|
Loading…
x
Reference in New Issue
Block a user