Enable new registry rename for Insteon (#17171)

* Enable new registry rename for Insteon

* Segment unique_id from name
This commit is contained in:
Brian Towles 2018-10-07 06:12:33 -05:00 committed by Paulus Schoutsen
parent 6e81ae096e
commit 592e1dc96a

View file

@ -465,6 +465,16 @@ class InsteonEntity(Entity):
"""Return the INSTEON group that the entity responds to."""
return self._insteon_device_state.group
@property
def unique_id(self) -> str:
"""Return a unique ID."""
if self._insteon_device_state.group == 0x01:
uid = self._insteon_device.id
else:
uid = '{:s}_{:d}'.format(self._insteon_device.id,
self._insteon_device_state.group)
return uid
@property
def name(self):
"""Return the name of the node (used for Entity_ID)."""