From 592e1dc96ab327f8840ea8e37fdc20deca19b749 Mon Sep 17 00:00:00 2001 From: Brian Towles Date: Sun, 7 Oct 2018 06:12:33 -0500 Subject: [PATCH] Enable new registry rename for Insteon (#17171) * Enable new registry rename for Insteon * Segment unique_id from name --- homeassistant/components/insteon/__init__.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/homeassistant/components/insteon/__init__.py b/homeassistant/components/insteon/__init__.py index 924baeaa560..b3bb6e73b94 100644 --- a/homeassistant/components/insteon/__init__.py +++ b/homeassistant/components/insteon/__init__.py @@ -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)."""