mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-21 16:26:43 +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) => ({
|
const outputDevices = inputDevices.map((device) => {
|
||||||
id: device.id,
|
const name = computeDeviceName(
|
||||||
name: computeDeviceName(
|
|
||||||
device,
|
device,
|
||||||
this.hass,
|
this.hass,
|
||||||
deviceEntityLookup[device.id]
|
deviceEntityLookup[device.id]
|
||||||
),
|
);
|
||||||
area:
|
|
||||||
device.area_id && areaLookup[device.area_id]
|
return {
|
||||||
? areaLookup[device.area_id].name
|
id: device.id,
|
||||||
: this.hass.localize("ui.components.device-picker.no_area"),
|
name: name,
|
||||||
strings: [device.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) {
|
if (!outputDevices.length) {
|
||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user