Add entity translations to QNAP QSW (#98915)
This commit is contained in:
parent
a89a5f486d
commit
56b99d2bc6
10 changed files with 61 additions and 29 deletions
|
@ -39,7 +39,6 @@ BUTTON_TYPES: Final[tuple[QswButtonDescription, ...]] = (
|
|||
device_class=ButtonDeviceClass.RESTART,
|
||||
entity_category=EntityCategory.CONFIG,
|
||||
key=QSW_REBOOT,
|
||||
name="Reboot",
|
||||
press_action=lambda qsw: qsw.reboot(),
|
||||
),
|
||||
)
|
||||
|
@ -58,6 +57,8 @@ async def async_setup_entry(
|
|||
class QswButton(QswDataEntity, ButtonEntity):
|
||||
"""Define a QNAP QSW button."""
|
||||
|
||||
_attr_has_entity_name = True
|
||||
|
||||
entity_description: QswButtonDescription
|
||||
|
||||
def __init__(
|
||||
|
@ -68,7 +69,6 @@ class QswButton(QswDataEntity, ButtonEntity):
|
|||
) -> None:
|
||||
"""Initialize."""
|
||||
super().__init__(coordinator, entry)
|
||||
self._attr_name = f"{self.product} {description.name}"
|
||||
self._attr_unique_id = f"{entry.unique_id}_{description.key}"
|
||||
self.entity_description = description
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue