mirror of
https://github.com/home-assistant/frontend.git
synced 2025-04-25 13:57:21 +00:00
Safeguard against non-existant area in device handling (#12475)
This commit is contained in:
parent
4b644d8bc5
commit
4cd8b76d7e
@ -198,7 +198,8 @@ export class HaDevicePicker extends SubscribeMixin(LitElement) {
|
|||||||
this.hass,
|
this.hass,
|
||||||
deviceEntityLookup[device.id]
|
deviceEntityLookup[device.id]
|
||||||
),
|
),
|
||||||
area: device.area_id
|
area:
|
||||||
|
device.area_id && areaLookup[device.area_id]
|
||||||
? areaLookup[device.area_id].name
|
? areaLookup[device.area_id].name
|
||||||
: this.hass.localize("ui.components.device-picker.no_area"),
|
: this.hass.localize("ui.components.device-picker.no_area"),
|
||||||
}));
|
}));
|
||||||
|
@ -197,7 +197,10 @@ export class HaConfigDeviceDashboard extends LitElement {
|
|||||||
),
|
),
|
||||||
model: device.model || "<unknown>",
|
model: device.model || "<unknown>",
|
||||||
manufacturer: device.manufacturer || "<unknown>",
|
manufacturer: device.manufacturer || "<unknown>",
|
||||||
area: device.area_id ? areaLookup[device.area_id].name : "—",
|
area:
|
||||||
|
device.area_id && areaLookup[device.area_id]
|
||||||
|
? areaLookup[device.area_id].name
|
||||||
|
: "—",
|
||||||
integration: device.config_entries.length
|
integration: device.config_entries.length
|
||||||
? device.config_entries
|
? device.config_entries
|
||||||
.filter((entId) => entId in entryLookup)
|
.filter((entId) => entId in entryLookup)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user