Add entity name translations to BraviaTV (#90702)

Add entity name translations
This commit is contained in:
Maciej Bieniek 2023-04-03 13:40:52 +02:00 committed by GitHub
parent 33a4c2c162
commit 1eadc63cd5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 2 deletions

View File

@ -36,14 +36,14 @@ class BraviaTVButtonDescription(
BUTTONS: tuple[BraviaTVButtonDescription, ...] = ( BUTTONS: tuple[BraviaTVButtonDescription, ...] = (
BraviaTVButtonDescription( BraviaTVButtonDescription(
key="reboot", key="reboot",
name="Reboot", translation_key="restart",
device_class=ButtonDeviceClass.RESTART, device_class=ButtonDeviceClass.RESTART,
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
press_action=lambda coordinator: coordinator.async_reboot_device(), press_action=lambda coordinator: coordinator.async_reboot_device(),
), ),
BraviaTVButtonDescription( BraviaTVButtonDescription(
key="terminate_apps", key="terminate_apps",
name="Terminate apps", translation_key="terminate_apps",
entity_category=EntityCategory.CONFIG, entity_category=EntityCategory.CONFIG,
press_action=lambda coordinator: coordinator.async_terminate_apps(), press_action=lambda coordinator: coordinator.async_terminate_apps(),
), ),

View File

@ -44,5 +44,15 @@
"not_bravia_device": "The device is not a Bravia TV.", "not_bravia_device": "The device is not a Bravia TV.",
"reauth_successful": "[%key:common::config_flow::abort::reauth_successful%]" "reauth_successful": "[%key:common::config_flow::abort::reauth_successful%]"
} }
},
"entity": {
"button": {
"restart": {
"name": "[%key:component::button::entity_component::restart::name%]"
},
"terminate_apps": {
"name": "Terminate apps"
}
}
} }
} }