Use capability of sensor if present to fix multisensor Wink devices (#18907)

This commit is contained in:
William Scanlon 2018-12-03 05:34:22 -05:00 committed by Paulus Schoutsen
parent d2b62840f2
commit 85c0de550c

View File

@ -690,6 +690,10 @@ class WinkDevice(Entity):
@property @property
def unique_id(self): def unique_id(self):
"""Return the unique id of the Wink device.""" """Return the unique id of the Wink device."""
if hasattr(self.wink, 'capability') and \
self.wink.capability() is not None:
return "{}_{}".format(self.wink.object_id(),
self.wink.capability())
return self.wink.object_id() return self.wink.object_id()
@property @property