From 83db673bd085a216efd4d0cbfcd8d5d36cd4cf39 Mon Sep 17 00:00:00 2001 From: Brant Knudson Date: Tue, 16 Oct 2018 16:27:57 -0500 Subject: [PATCH] Add unique_id to Vera entities (#17450) I believe this adds registry support. The UI allows me to change the entity ID now. For example, a light bulb called "BasementHallLight" in the Vera has an initial Entity ID like light.basementhalllight_108, where 108 is the unique ID that the Vera assigned the device when I added it to the z-wave network. Now I can use the UI to change the Entity ID to light.basementhalllight and I can still turn it on and off. --- homeassistant/components/vera.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/homeassistant/components/vera.py b/homeassistant/components/vera.py index fb8af0d8855..127cd008a3a 100644 --- a/homeassistant/components/vera.py +++ b/homeassistant/components/vera.py @@ -195,3 +195,11 @@ class VeraDevice(Entity): attr['Vera Device Id'] = self.vera_device.vera_device_id return attr + + @property + def unique_id(self) -> str: + """Return a unique ID. + + The Vera assigns a unique and immutable ID number to each device. + """ + return str(self.vera_device.vera_device_id)