Add translation placeholder to Hue (#108848)
This commit is contained in:
parent
7c59b0b43c
commit
a01e73a575
2 changed files with 4 additions and 6 deletions
|
@ -86,12 +86,9 @@ class HueButtonEventEntity(HueBaseEntity, EventEntity):
|
|||
):
|
||||
event_types.append(event_type.value)
|
||||
self._attr_event_types = event_types
|
||||
|
||||
@property
|
||||
def name(self) -> str:
|
||||
"""Return name for the entity."""
|
||||
# this can be translated too as soon as we support arguments into translations ?
|
||||
return f"Button {self.resource.metadata.control_id}"
|
||||
self._attr_translation_placeholders = {
|
||||
"button_id": self.resource.metadata.control_id
|
||||
}
|
||||
|
||||
@callback
|
||||
def _handle_event(self, event_type: EventType, resource: Button) -> None:
|
||||
|
|
|
@ -76,6 +76,7 @@
|
|||
"entity": {
|
||||
"event": {
|
||||
"button": {
|
||||
"name": "Button {button_id}",
|
||||
"state_attributes": {
|
||||
"event_type": {
|
||||
"state": {
|
||||
|
|
Loading…
Add table
Reference in a new issue