Use translation_placeholders in tuya number descriptions (#149250)

This commit is contained in:
epenet 2025-07-22 19:06:14 +02:00 committed by GitHub
parent 252a46d141
commit 316ac6253b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 24 additions and 20 deletions

View File

@ -266,32 +266,38 @@ NUMBERS: dict[str, tuple[NumberEntityDescription, ...]] = {
"tgkg": (
NumberEntityDescription(
key=DPCode.BRIGHTNESS_MIN_1,
translation_key="minimum_brightness",
translation_key="indexed_minimum_brightness",
translation_placeholders={"index": "1"},
entity_category=EntityCategory.CONFIG,
),
NumberEntityDescription(
key=DPCode.BRIGHTNESS_MAX_1,
translation_key="maximum_brightness",
translation_key="indexed_maximum_brightness",
translation_placeholders={"index": "1"},
entity_category=EntityCategory.CONFIG,
),
NumberEntityDescription(
key=DPCode.BRIGHTNESS_MIN_2,
translation_key="minimum_brightness_2",
translation_key="indexed_minimum_brightness",
translation_placeholders={"index": "2"},
entity_category=EntityCategory.CONFIG,
),
NumberEntityDescription(
key=DPCode.BRIGHTNESS_MAX_2,
translation_key="maximum_brightness_2",
translation_key="indexed_maximum_brightness",
translation_placeholders={"index": "2"},
entity_category=EntityCategory.CONFIG,
),
NumberEntityDescription(
key=DPCode.BRIGHTNESS_MIN_3,
translation_key="minimum_brightness_3",
translation_key="indexed_minimum_brightness",
translation_placeholders={"index": "3"},
entity_category=EntityCategory.CONFIG,
),
NumberEntityDescription(
key=DPCode.BRIGHTNESS_MAX_3,
translation_key="maximum_brightness_3",
translation_key="indexed_maximum_brightness",
translation_placeholders={"index": "3"},
entity_category=EntityCategory.CONFIG,
),
),
@ -300,22 +306,26 @@ NUMBERS: dict[str, tuple[NumberEntityDescription, ...]] = {
"tgq": (
NumberEntityDescription(
key=DPCode.BRIGHTNESS_MIN_1,
translation_key="minimum_brightness",
translation_key="indexed_minimum_brightness",
translation_placeholders={"index": "1"},
entity_category=EntityCategory.CONFIG,
),
NumberEntityDescription(
key=DPCode.BRIGHTNESS_MAX_1,
translation_key="maximum_brightness",
translation_key="indexed_maximum_brightness",
translation_placeholders={"index": "1"},
entity_category=EntityCategory.CONFIG,
),
NumberEntityDescription(
key=DPCode.BRIGHTNESS_MIN_2,
translation_key="minimum_brightness_2",
translation_key="indexed_minimum_brightness",
translation_placeholders={"index": "2"},
entity_category=EntityCategory.CONFIG,
),
NumberEntityDescription(
key=DPCode.BRIGHTNESS_MAX_2,
translation_key="maximum_brightness_2",
translation_key="indexed_maximum_brightness",
translation_placeholders={"index": "2"},
entity_category=EntityCategory.CONFIG,
),
),

View File

@ -199,17 +199,11 @@
"maximum_brightness": {
"name": "Maximum brightness"
},
"minimum_brightness_2": {
"name": "Minimum brightness 2"
"indexed_minimum_brightness": {
"name": "Minimum brightness {index}"
},
"maximum_brightness_2": {
"name": "Maximum brightness 2"
},
"minimum_brightness_3": {
"name": "Minimum brightness 3"
},
"maximum_brightness_3": {
"name": "Maximum brightness 3"
"indexed_maximum_brightness": {
"name": "Maximum brightness {index}"
},
"move_down": {
"name": "Move down"