From e14fa32d54d5ebcce892f1f8298d2a316783851c Mon Sep 17 00:00:00 2001 From: Jason Rhubottom Date: Sat, 21 Sep 2024 21:06:43 -0700 Subject: [PATCH] Sort by device --- custom_components/device_tools/config_flow.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom_components/device_tools/config_flow.py b/custom_components/device_tools/config_flow.py index 685aff7..daf9883 100644 --- a/custom_components/device_tools/config_flow.py +++ b/custom_components/device_tools/config_flow.py @@ -277,7 +277,7 @@ async def async_step_user( or device.id, } ) - for device in self.device_registry.devices.values() + for device in sorted(list(self.device_registry.devices.values()),key=lambda x: x.name_by_user or x.name or x.id) if device.id not in other_device_ids and device.disabled_by is None ],