Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 19 additions & 17 deletions src/panels/lovelace/components/hui-entity-editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,29 +39,31 @@ export class HuiEntityEditor extends LitElement {
private _renderItem(item: EntityConfig, index: number) {
const stateObj = this.hass.states[item.entity];

const useDeviceName = entityUseDeviceName(
stateObj,
this.hass.entities,
this.hass.devices
);
const useDeviceName =
stateObj &&
entityUseDeviceName(stateObj, this.hass.entities, this.hass.devices);

const isRTL = computeRTL(this.hass);

const primary =
(stateObj &&
this.hass.formatEntityName(
stateObj,
useDeviceName ? { type: "device" } : { type: "entity" }
)) ||
item.entity;

const secondary =
stateObj &&
this.hass.formatEntityName(
stateObj,
useDeviceName ? { type: "device" } : { type: "entity" }
) || item.entity;

const secondary = this.hass.formatEntityName(
stateObj,
useDeviceName
? [{ type: "area" }]
: [{ type: "area" }, { type: "device" }],
{
separator: isRTL ? " ◂ " : " ▸ ",
}
);
useDeviceName
? [{ type: "area" }]
: [{ type: "area" }, { type: "device" }],
{
separator: isRTL ? " ◂ " : " ▸ ",
}
);

return html`
<ha-md-list-item class="item">
Expand Down
Loading