mirror of
https://github.com/home-assistant/frontend.git
synced 2025-11-09 10:59:50 +00:00
Add trigger/condition/action dialog - Show device group always on top (#27812)
add automation element dialog Device always on top
This commit is contained in:
@@ -383,9 +383,16 @@ class DialogAddAutomationElement
|
|||||||
|
|
||||||
generatedCollections.push({
|
generatedCollections.push({
|
||||||
titleKey: collection.titleKey,
|
titleKey: collection.titleKey,
|
||||||
groups: groups.sort((a, b) =>
|
groups: groups.sort((a, b) => {
|
||||||
stringCompare(a.name, b.name, this.hass.locale.language)
|
// make sure device is always on top
|
||||||
),
|
if (a.key === "device" || a.key === "device_id") {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
if (b.key === "device" || b.key === "device_id") {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
return stringCompare(a.name, b.name, this.hass.locale.language);
|
||||||
|
}),
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
return generatedCollections;
|
return generatedCollections;
|
||||||
|
|||||||
Reference in New Issue
Block a user