Only link the parent device if known in SmartThings (#141719)

Only link the parent device if we know the parent device
This commit is contained in:
Joost Lekkerkerker 2025-03-29 10:18:27 +01:00 committed by GitHub
parent d88f7b8600
commit b55f1df297
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -426,7 +426,7 @@ def create_devices(
kwargs[ATTR_CONNECTIONS] = {
(dr.CONNECTION_NETWORK_MAC, device.device.hub.mac_address)
}
if device.device.parent_device_id:
if device.device.parent_device_id and device.device.parent_device_id in devices:
kwargs[ATTR_VIA_DEVICE] = (DOMAIN, device.device.parent_device_id)
if (ocf := device.device.ocf) is not None:
kwargs.update(