Use translation_placeholders in tuya cover descriptions (#149248)

Co-authored-by: Simone Chemelli <simone.chemelli@gmail.com>
This commit is contained in:
epenet 2025-07-22 22:21:59 +02:00 committed by GitHub
parent 55ac4d8855
commit 34eb99530f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 16 additions and 19 deletions

View File

@ -44,21 +44,24 @@ COVERS: dict[str, tuple[TuyaCoverEntityDescription, ...]] = {
"ckmkzq": (
TuyaCoverEntityDescription(
key=DPCode.SWITCH_1,
translation_key="door",
translation_key="indexed_door",
translation_placeholders={"index": "1"},
current_state=DPCode.DOORCONTACT_STATE,
current_state_inverse=True,
device_class=CoverDeviceClass.GARAGE,
),
TuyaCoverEntityDescription(
key=DPCode.SWITCH_2,
translation_key="door_2",
translation_key="indexed_door",
translation_placeholders={"index": "2"},
current_state=DPCode.DOORCONTACT_STATE_2,
current_state_inverse=True,
device_class=CoverDeviceClass.GARAGE,
),
TuyaCoverEntityDescription(
key=DPCode.SWITCH_3,
translation_key="door_3",
translation_key="indexed_door",
translation_placeholders={"index": "3"},
current_state=DPCode.DOORCONTACT_STATE_3,
current_state_inverse=True,
device_class=CoverDeviceClass.GARAGE,
@ -78,14 +81,16 @@ COVERS: dict[str, tuple[TuyaCoverEntityDescription, ...]] = {
),
TuyaCoverEntityDescription(
key=DPCode.CONTROL_2,
translation_key="curtain_2",
translation_key="indexed_curtain",
translation_placeholders={"index": "2"},
current_position=DPCode.PERCENT_STATE_2,
set_position=DPCode.PERCENT_CONTROL_2,
device_class=CoverDeviceClass.CURTAIN,
),
TuyaCoverEntityDescription(
key=DPCode.CONTROL_3,
translation_key="curtain_3",
translation_key="indexed_curtain",
translation_placeholders={"index": "3"},
current_position=DPCode.PERCENT_STATE_3,
set_position=DPCode.PERCENT_CONTROL_3,
device_class=CoverDeviceClass.CURTAIN,
@ -122,7 +127,8 @@ COVERS: dict[str, tuple[TuyaCoverEntityDescription, ...]] = {
),
TuyaCoverEntityDescription(
key=DPCode.CONTROL_2,
translation_key="curtain_2",
translation_key="indexed_curtain",
translation_placeholders={"index": "2"},
current_position=DPCode.PERCENT_CONTROL_2,
set_position=DPCode.PERCENT_CONTROL_2,
device_class=CoverDeviceClass.CURTAIN,

View File

@ -94,20 +94,11 @@
"curtain": {
"name": "[%key:component::cover::entity_component::curtain::name%]"
},
"curtain_2": {
"name": "Curtain 2"
"indexed_curtain": {
"name": "Curtain {index}"
},
"curtain_3": {
"name": "Curtain 3"
},
"door": {
"name": "[%key:component::cover::entity_component::door::name%]"
},
"door_2": {
"name": "Door 2"
},
"door_3": {
"name": "Door 3"
"indexed_door": {
"name": "Door {index}"
}
},
"event": {