Skip to content

Commit

Permalink
Add translation keys to Tuya cover (#98040)
Browse files Browse the repository at this point in the history
  • Loading branch information
joostlek committed Aug 8, 2023
1 parent ce10779 commit c78c2b7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions homeassistant/components/tuya/cover.py
Expand Up @@ -44,6 +44,7 @@ class TuyaCoverEntityDescription(CoverEntityDescription):
"cl": (
TuyaCoverEntityDescription(
key=DPCode.CONTROL,
translation_key="curtain",
current_state=DPCode.SITUATION_SET,
current_position=(DPCode.PERCENT_CONTROL, DPCode.PERCENT_STATE),
set_position=DPCode.PERCENT_CONTROL,
Expand All @@ -65,6 +66,7 @@ class TuyaCoverEntityDescription(CoverEntityDescription):
),
TuyaCoverEntityDescription(
key=DPCode.MACH_OPERATE,
translation_key="curtain",
current_position=DPCode.POSITION,
set_position=DPCode.POSITION,
device_class=CoverDeviceClass.CURTAIN,
Expand All @@ -76,6 +78,7 @@ class TuyaCoverEntityDescription(CoverEntityDescription):
# It is used by the Kogan Smart Blinds Driver
TuyaCoverEntityDescription(
key=DPCode.SWITCH_1,
translation_key="blind",
current_position=DPCode.PERCENT_CONTROL,
set_position=DPCode.PERCENT_CONTROL,
device_class=CoverDeviceClass.BLIND,
Expand Down Expand Up @@ -111,6 +114,7 @@ class TuyaCoverEntityDescription(CoverEntityDescription):
"clkg": (
TuyaCoverEntityDescription(
key=DPCode.CONTROL,
translation_key="curtain",
current_position=DPCode.PERCENT_CONTROL,
set_position=DPCode.PERCENT_CONTROL,
device_class=CoverDeviceClass.CURTAIN,
Expand All @@ -128,6 +132,7 @@ class TuyaCoverEntityDescription(CoverEntityDescription):
"jdcljqr": (
TuyaCoverEntityDescription(
key=DPCode.CONTROL,
translation_key="curtain",
current_position=DPCode.PERCENT_STATE,
set_position=DPCode.PERCENT_CONTROL,
device_class=CoverDeviceClass.CURTAIN,
Expand Down
6 changes: 6 additions & 0 deletions homeassistant/components/tuya/strings.json
Expand Up @@ -71,6 +71,12 @@
}
},
"cover": {
"blind": {
"name": "[%key:component::cover::entity_component::blind::name%]"
},
"curtain": {
"name": "[%key:component::cover::entity_component::curtain::name%]"
},
"curtain_2": {
"name": "Curtain 2"
},
Expand Down

0 comments on commit c78c2b7

Please sign in to comment.