Add plum_lightpad unique ids (#36549)

This commit is contained in:
Eugene Prystupa 2020-06-08 00:52:03 -04:00 committed by GitHub
parent fbbc681ad4
commit de7bbd3e24
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -54,6 +54,11 @@ class PlumLight(LightEntity):
"""No polling needed."""
return False
@property
def unique_id(self):
"""Combine logical load ID with .light to guarantee it is unique."""
return f"{self._load.llid}.light"
@property
def name(self):
"""Return the name of the switch if any."""
@ -130,6 +135,11 @@ class GlowRing(LightEntity):
"""No polling needed."""
return False
@property
def unique_id(self):
"""Combine LightPad ID with .glow to guarantee it is unique."""
return f"{self._lightpad.lpid}.glow"
@property
def name(self):
"""Return the name of the switch if any."""