mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-22 16:56:35 +00:00
Add fallback for devices without name (#23513)
This commit is contained in:
parent
700690474c
commit
884c22f92b
@ -222,7 +222,9 @@ export class HaDevicePicker extends LitElement {
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
id: device.id,
|
id: device.id,
|
||||||
name: name,
|
name:
|
||||||
|
name ||
|
||||||
|
this.hass.localize("ui.components.device-picker.unnamed_device"),
|
||||||
area:
|
area:
|
||||||
device.area_id && areas[device.area_id]
|
device.area_id && areas[device.area_id]
|
||||||
? areas[device.area_id].name
|
? areas[device.area_id].name
|
||||||
|
@ -530,7 +530,9 @@ export class QuickBar extends LitElement {
|
|||||||
? this.hass.areas[device.area_id]
|
? this.hass.areas[device.area_id]
|
||||||
: undefined;
|
: undefined;
|
||||||
const deviceItem = {
|
const deviceItem = {
|
||||||
primaryText: computeDeviceName(device, this.hass),
|
primaryText:
|
||||||
|
computeDeviceName(device, this.hass) ||
|
||||||
|
this.hass.localize("ui.components.device-picker.unnamed_device"),
|
||||||
deviceId: device.id,
|
deviceId: device.id,
|
||||||
area: area?.name,
|
area: area?.name,
|
||||||
action: () => navigate(`/config/devices/device/${device.id}`),
|
action: () => navigate(`/config/devices/device/${device.id}`),
|
||||||
|
@ -651,6 +651,7 @@
|
|||||||
"no_devices": "You don't have any devices",
|
"no_devices": "You don't have any devices",
|
||||||
"no_match": "No matching devices found",
|
"no_match": "No matching devices found",
|
||||||
"device": "Device",
|
"device": "Device",
|
||||||
|
"unnamed_device": "Unnamed device",
|
||||||
"no_area": "No area"
|
"no_area": "No area"
|
||||||
},
|
},
|
||||||
"category-picker": {
|
"category-picker": {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user