mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-21 08:16:36 +00:00
Use the user-provided name when sorting devices (#17297)
This commit is contained in:
parent
4a044fc40e
commit
11b2cf9e22
@ -230,19 +230,23 @@ export class HaDevicePicker extends SubscribeMixin(LitElement) {
|
||||
);
|
||||
}
|
||||
|
||||
const outputDevices = inputDevices.map((device) => ({
|
||||
id: device.id,
|
||||
name: computeDeviceName(
|
||||
const outputDevices = inputDevices.map((device) => {
|
||||
const name = computeDeviceName(
|
||||
device,
|
||||
this.hass,
|
||||
deviceEntityLookup[device.id]
|
||||
),
|
||||
area:
|
||||
device.area_id && areaLookup[device.area_id]
|
||||
? areaLookup[device.area_id].name
|
||||
: this.hass.localize("ui.components.device-picker.no_area"),
|
||||
strings: [device.name || ""],
|
||||
}));
|
||||
);
|
||||
|
||||
return {
|
||||
id: device.id,
|
||||
name: name,
|
||||
area:
|
||||
device.area_id && areaLookup[device.area_id]
|
||||
? areaLookup[device.area_id].name
|
||||
: this.hass.localize("ui.components.device-picker.no_area"),
|
||||
strings: [name || ""],
|
||||
};
|
||||
});
|
||||
if (!outputDevices.length) {
|
||||
return [
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user