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.
This commit is contained in:
Brant Knudson 2018-10-16 16:27:57 -05:00 committed by Paulus Schoutsen
parent 6b3e4ca7bd
commit 83db673bd0

View file

@ -195,3 +195,11 @@ class VeraDevice(Entity):
attr['Vera Device Id'] = self.vera_device.vera_device_id attr['Vera Device Id'] = self.vera_device.vera_device_id
return attr 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)