Don't return a unique_id if Lutron doesn't have a UUID for the device. (#56113)

This is a workaround for https://github.com/thecynic/pylutron/issues/70

Co-authored-by: cdheiser <cdheiser@users.noreply.github.com>
This commit is contained in:
cdheiser 2021-09-12 00:24:02 -07:00 committed by GitHub
parent 4a449902a5
commit ec28f7eef2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -131,6 +131,9 @@ class LutronDevice(Entity):
@property
def unique_id(self):
"""Return a unique ID."""
# Temporary fix for https://github.com/thecynic/pylutron/issues/70
if self._lutron_device.uuid is None:
return None
return f"{self._controller.guid}_{self._lutron_device.uuid}"