Migrate Plum Lightpad to has entity name (#96744)

pull/96743/head^2
Joost Lekkerkerker 2023-07-17 14:42:58 +02:00 committed by GitHub
parent b0dd05a411
commit e76254a50f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 6 deletions

View File

@ -66,6 +66,8 @@ class PlumLight(LightEntity):
"""Representation of a Plum Lightpad dimmer."""
_attr_should_poll = False
_attr_has_entity_name = True
_attr_name = None
def __init__(self, load):
"""Initialize the light."""
@ -86,11 +88,6 @@ class PlumLight(LightEntity):
"""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."""
return self._load.name
@property
def device_info(self) -> DeviceInfo:
"""Return the device info."""
@ -98,7 +95,7 @@ class PlumLight(LightEntity):
identifiers={(DOMAIN, self.unique_id)},
manufacturer="Plum",
model="Dimmer",
name=self.name,
name=self._load.name,
)
@property