mirror of
https://github.com/home-assistant/core.git
synced 2025-07-26 06:37:52 +00:00
Migrate Plum Lightpad to has entity name (#96744)
This commit is contained in:
parent
b0dd05a411
commit
e76254a50f
@ -66,6 +66,8 @@ class PlumLight(LightEntity):
|
|||||||
"""Representation of a Plum Lightpad dimmer."""
|
"""Representation of a Plum Lightpad dimmer."""
|
||||||
|
|
||||||
_attr_should_poll = False
|
_attr_should_poll = False
|
||||||
|
_attr_has_entity_name = True
|
||||||
|
_attr_name = None
|
||||||
|
|
||||||
def __init__(self, load):
|
def __init__(self, load):
|
||||||
"""Initialize the light."""
|
"""Initialize the light."""
|
||||||
@ -86,11 +88,6 @@ class PlumLight(LightEntity):
|
|||||||
"""Combine logical load ID with .light to guarantee it is unique."""
|
"""Combine logical load ID with .light to guarantee it is unique."""
|
||||||
return f"{self._load.llid}.light"
|
return f"{self._load.llid}.light"
|
||||||
|
|
||||||
@property
|
|
||||||
def name(self):
|
|
||||||
"""Return the name of the switch if any."""
|
|
||||||
return self._load.name
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_info(self) -> DeviceInfo:
|
def device_info(self) -> DeviceInfo:
|
||||||
"""Return the device info."""
|
"""Return the device info."""
|
||||||
@ -98,7 +95,7 @@ class PlumLight(LightEntity):
|
|||||||
identifiers={(DOMAIN, self.unique_id)},
|
identifiers={(DOMAIN, self.unique_id)},
|
||||||
manufacturer="Plum",
|
manufacturer="Plum",
|
||||||
model="Dimmer",
|
model="Dimmer",
|
||||||
name=self.name,
|
name=self._load.name,
|
||||||
)
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
Loading…
x
Reference in New Issue
Block a user