mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-26 02:36:37 +00:00
Improve code
This commit is contained in:
parent
9a12d563ec
commit
efbfff9a4f
@ -307,7 +307,7 @@ export class MoreInfoDialog extends LitElement {
|
|||||||
deviceName = this.hass.formatEntityName(stateObj, "device");
|
deviceName = this.hass.formatEntityName(stateObj, "device");
|
||||||
areaName = this.hass.formatEntityName(stateObj, "area");
|
areaName = this.hass.formatEntityName(stateObj, "area");
|
||||||
} else if (this._entry) {
|
} else if (this._entry) {
|
||||||
const context = getEntityEntryContext(
|
const { device, area } = getEntityEntryContext(
|
||||||
this._entry,
|
this._entry,
|
||||||
this.hass.entities,
|
this.hass.entities,
|
||||||
this.hass.devices,
|
this.hass.devices,
|
||||||
@ -315,10 +315,8 @@ export class MoreInfoDialog extends LitElement {
|
|||||||
this.hass.floors
|
this.hass.floors
|
||||||
);
|
);
|
||||||
entityName = computeEntityEntryName(this._entry, this.hass.devices);
|
entityName = computeEntityEntryName(this._entry, this.hass.devices);
|
||||||
deviceName = context?.device
|
deviceName = device ? computeDeviceName(device) : undefined;
|
||||||
? computeDeviceName(context.device)
|
areaName = area ? computeAreaName(area) : undefined;
|
||||||
: undefined;
|
|
||||||
areaName = context?.area ? computeAreaName(context.area) : undefined;
|
|
||||||
} else {
|
} else {
|
||||||
entityName = entityId;
|
entityName = entityId;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user