Sort SmartThings devices to be created by parent device id (#141515)

This commit is contained in:
Joost Lekkerkerker 2025-03-26 20:52:39 +01:00 committed by GitHub
parent eb901bcf3a
commit 46ee3d2b26
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -410,7 +410,9 @@ def create_devices(
rooms: dict[str, str],
) -> None:
"""Create devices in the device registry."""
for device in devices.values():
for device in sorted(
devices.values(), key=lambda d: d.device.parent_device_id or ""
):
kwargs: dict[str, Any] = {}
if device.device.hub is not None:
kwargs = {