Handle LinkPlay devices with no mac (#136272)

Co-authored-by: J. Nick Koston <nick@koston.org>
This commit is contained in:
Simon Lamon 2025-01-23 20:36:59 +01:00 committed by Franck Nijhof
parent e7a4f5fd27
commit 0caa1ed825
No known key found for this signature in database
GPG Key ID: D62583BA8AB11CA3

View File

@ -44,9 +44,15 @@ class LinkPlayBaseEntity(Entity):
if model != MANUFACTURER_GENERIC:
model_id = bridge.device.properties["project"]
connections: set[tuple[str, str]] = set()
if "MAC" in bridge.device.properties:
connections.add(
(dr.CONNECTION_NETWORK_MAC, bridge.device.properties["MAC"])
)
self._attr_device_info = dr.DeviceInfo(
configuration_url=bridge.endpoint,
connections={(dr.CONNECTION_NETWORK_MAC, bridge.device.properties["MAC"])},
connections=connections,
hw_version=bridge.device.properties["hardware"],
identifiers={(DOMAIN, bridge.device.uuid)},
manufacturer=manufacturer,