mirror of
https://github.com/home-assistant/core.git
synced 2025-07-13 16:27:08 +00:00
Migrate Laundrify to has entity name (#96703)
This commit is contained in:
parent
13140830a0
commit
13ac8d00f9
@ -42,6 +42,8 @@ class LaundrifyPowerPlug(
|
|||||||
_attr_device_class = BinarySensorDeviceClass.RUNNING
|
_attr_device_class = BinarySensorDeviceClass.RUNNING
|
||||||
_attr_icon = "mdi:washing-machine"
|
_attr_icon = "mdi:washing-machine"
|
||||||
_attr_unique_id: str
|
_attr_unique_id: str
|
||||||
|
_attr_has_entity_name = True
|
||||||
|
_attr_name = None
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self, coordinator: LaundrifyUpdateCoordinator, device: LaundrifyDevice
|
self, coordinator: LaundrifyUpdateCoordinator, device: LaundrifyDevice
|
||||||
@ -56,7 +58,7 @@ class LaundrifyPowerPlug(
|
|||||||
"""Configure the Device of this Entity."""
|
"""Configure the Device of this Entity."""
|
||||||
return DeviceInfo(
|
return DeviceInfo(
|
||||||
identifiers={(DOMAIN, self._device["_id"])},
|
identifiers={(DOMAIN, self._device["_id"])},
|
||||||
name=self.name,
|
name=self._device["name"],
|
||||||
manufacturer=MANUFACTURER,
|
manufacturer=MANUFACTURER,
|
||||||
model=MODEL,
|
model=MODEL,
|
||||||
sw_version=self._device["firmwareVersion"],
|
sw_version=self._device["firmwareVersion"],
|
||||||
@ -70,11 +72,6 @@ class LaundrifyPowerPlug(
|
|||||||
and self.coordinator.last_update_success
|
and self.coordinator.last_update_success
|
||||||
)
|
)
|
||||||
|
|
||||||
@property
|
|
||||||
def name(self) -> str:
|
|
||||||
"""Name of the entity."""
|
|
||||||
return self._device["name"]
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def is_on(self) -> bool:
|
def is_on(self) -> bool:
|
||||||
"""Return entity state."""
|
"""Return entity state."""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user