mirror of
https://github.com/home-assistant/core.git
synced 2025-07-11 15:27:08 +00:00
Add translation placeholder to Hue (#108848)
This commit is contained in:
parent
7c59b0b43c
commit
a01e73a575
@ -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:
|
||||||
|
@ -76,6 +76,7 @@
|
|||||||
"entity": {
|
"entity": {
|
||||||
"event": {
|
"event": {
|
||||||
"button": {
|
"button": {
|
||||||
|
"name": "Button {button_id}",
|
||||||
"state_attributes": {
|
"state_attributes": {
|
||||||
"event_type": {
|
"event_type": {
|
||||||
"state": {
|
"state": {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user