Add translation placeholder to Hue (#108848)

This commit is contained in:
Joost Lekkerkerker 2024-01-28 20:40:21 +01:00 committed by GitHub
parent 7c59b0b43c
commit a01e73a575
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 6 deletions

View File

@ -86,12 +86,9 @@ class HueButtonEventEntity(HueBaseEntity, EventEntity):
): ):
event_types.append(event_type.value) event_types.append(event_type.value)
self._attr_event_types = event_types self._attr_event_types = event_types
self._attr_translation_placeholders = {
@property "button_id": self.resource.metadata.control_id
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}"
@callback @callback
def _handle_event(self, event_type: EventType, resource: Button) -> None: def _handle_event(self, event_type: EventType, resource: Button) -> None:

View File

@ -76,6 +76,7 @@
"entity": { "entity": {
"event": { "event": {
"button": { "button": {
"name": "Button {button_id}",
"state_attributes": { "state_attributes": {
"event_type": { "event_type": {
"state": { "state": {