Add fallback for devices without name (#23513)

This commit is contained in:
Bram Kragten 2024-12-30 17:06:26 +01:00
parent 700690474c
commit 884c22f92b
3 changed files with 7 additions and 2 deletions

View File

@ -222,7 +222,9 @@ export class HaDevicePicker extends LitElement {
return {
id: device.id,
name: name,
name:
name ||
this.hass.localize("ui.components.device-picker.unnamed_device"),
area:
device.area_id && areas[device.area_id]
? areas[device.area_id].name

View File

@ -530,7 +530,9 @@ export class QuickBar extends LitElement {
? this.hass.areas[device.area_id]
: undefined;
const deviceItem = {
primaryText: computeDeviceName(device, this.hass),
primaryText:
computeDeviceName(device, this.hass) ||
this.hass.localize("ui.components.device-picker.unnamed_device"),
deviceId: device.id,
area: area?.name,
action: () => navigate(`/config/devices/device/${device.id}`),

View File

@ -651,6 +651,7 @@
"no_devices": "You don't have any devices",
"no_match": "No matching devices found",
"device": "Device",
"unnamed_device": "Unnamed device",
"no_area": "No area"
},
"category-picker": {