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)
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:

View file

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