Use translation_placeholders in tuya select descriptions (#149251)

This commit is contained in:
epenet 2025-07-22 19:05:54 +02:00 committed by GitHub
parent 969ad232aa
commit 252a46d141
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 12 additions and 15 deletions

View File

@ -320,17 +320,20 @@ SELECTS: dict[str, tuple[SelectEntityDescription, ...]] = {
SelectEntityDescription(
key=DPCode.LED_TYPE_1,
entity_category=EntityCategory.CONFIG,
translation_key="led_type",
translation_key="indexed_led_type",
translation_placeholders={"index": "1"},
),
SelectEntityDescription(
key=DPCode.LED_TYPE_2,
entity_category=EntityCategory.CONFIG,
translation_key="led_type_2",
translation_key="indexed_led_type",
translation_placeholders={"index": "2"},
),
SelectEntityDescription(
key=DPCode.LED_TYPE_3,
entity_category=EntityCategory.CONFIG,
translation_key="led_type_3",
translation_key="indexed_led_type",
translation_placeholders={"index": "3"},
),
),
# Dimmer
@ -339,12 +342,14 @@ SELECTS: dict[str, tuple[SelectEntityDescription, ...]] = {
SelectEntityDescription(
key=DPCode.LED_TYPE_1,
entity_category=EntityCategory.CONFIG,
translation_key="led_type",
translation_key="indexed_led_type",
translation_placeholders={"index": "1"},
),
SelectEntityDescription(
key=DPCode.LED_TYPE_2,
entity_category=EntityCategory.CONFIG,
translation_key="led_type_2",
translation_key="indexed_led_type",
translation_placeholders={"index": "2"},
),
),
}

View File

@ -296,16 +296,8 @@
"led": "LED"
}
},
"led_type_2": {
"name": "Light 2 source type",
"state": {
"halogen": "[%key:component::tuya::entity::select::led_type::state::halogen%]",
"incandescent": "[%key:component::tuya::entity::select::led_type::state::incandescent%]",
"led": "[%key:component::tuya::entity::select::led_type::state::led%]"
}
},
"led_type_3": {
"name": "Light 3 source type",
"indexed_led_type": {
"name": "Light {index} source type",
"state": {
"halogen": "[%key:component::tuya::entity::select::led_type::state::halogen%]",
"incandescent": "[%key:component::tuya::entity::select::led_type::state::incandescent%]",