mirror of
https://github.com/home-assistant/core.git
synced 2025-07-31 17:18:23 +00:00
Use translation_placeholders in tuya switch descriptions (#149664)
This commit is contained in:
parent
15e45df8a7
commit
5930ac6425
@ -744,86 +744,26 @@
|
||||
"switch": {
|
||||
"name": "Switch"
|
||||
},
|
||||
"indexed_switch": {
|
||||
"name": "Switch {index}"
|
||||
},
|
||||
"socket": {
|
||||
"name": "Socket"
|
||||
},
|
||||
"indexed_socket": {
|
||||
"name": "Socket {index}"
|
||||
},
|
||||
"radio": {
|
||||
"name": "Radio"
|
||||
},
|
||||
"alarm_1": {
|
||||
"name": "Alarm 1"
|
||||
},
|
||||
"alarm_2": {
|
||||
"name": "Alarm 2"
|
||||
},
|
||||
"alarm_3": {
|
||||
"name": "Alarm 3"
|
||||
},
|
||||
"alarm_4": {
|
||||
"name": "Alarm 4"
|
||||
"indexed_alarm": {
|
||||
"name": "Alarm {index}"
|
||||
},
|
||||
"sleep_aid": {
|
||||
"name": "Sleep aid"
|
||||
},
|
||||
"switch_1": {
|
||||
"name": "Switch 1"
|
||||
},
|
||||
"switch_2": {
|
||||
"name": "Switch 2"
|
||||
},
|
||||
"switch_3": {
|
||||
"name": "Switch 3"
|
||||
},
|
||||
"switch_4": {
|
||||
"name": "Switch 4"
|
||||
},
|
||||
"switch_5": {
|
||||
"name": "Switch 5"
|
||||
},
|
||||
"switch_6": {
|
||||
"name": "Switch 6"
|
||||
},
|
||||
"switch_7": {
|
||||
"name": "Switch 7"
|
||||
},
|
||||
"switch_8": {
|
||||
"name": "Switch 8"
|
||||
},
|
||||
"usb_1": {
|
||||
"name": "USB 1"
|
||||
},
|
||||
"usb_2": {
|
||||
"name": "USB 2"
|
||||
},
|
||||
"usb_3": {
|
||||
"name": "USB 3"
|
||||
},
|
||||
"usb_4": {
|
||||
"name": "USB 4"
|
||||
},
|
||||
"usb_5": {
|
||||
"name": "USB 5"
|
||||
},
|
||||
"usb_6": {
|
||||
"name": "USB 6"
|
||||
},
|
||||
"socket_1": {
|
||||
"name": "Socket 1"
|
||||
},
|
||||
"socket_2": {
|
||||
"name": "Socket 2"
|
||||
},
|
||||
"socket_3": {
|
||||
"name": "Socket 3"
|
||||
},
|
||||
"socket_4": {
|
||||
"name": "Socket 4"
|
||||
},
|
||||
"socket_5": {
|
||||
"name": "Socket 5"
|
||||
},
|
||||
"socket_6": {
|
||||
"name": "Socket 6"
|
||||
"indexed_usb": {
|
||||
"name": "USB {index}"
|
||||
},
|
||||
"ionizer": {
|
||||
"name": "Ionizer"
|
||||
|
@ -232,35 +232,43 @@ SWITCHES: dict[str, tuple[SwitchEntityDescription, ...]] = {
|
||||
"ggq": (
|
||||
SwitchEntityDescription(
|
||||
key=DPCode.SWITCH_1,
|
||||
translation_key="switch_1",
|
||||
translation_key="indexed_switch",
|
||||
translation_placeholders={"index": "1"},
|
||||
),
|
||||
SwitchEntityDescription(
|
||||
key=DPCode.SWITCH_2,
|
||||
translation_key="switch_2",
|
||||
translation_key="indexed_switch",
|
||||
translation_placeholders={"index": "2"},
|
||||
),
|
||||
SwitchEntityDescription(
|
||||
key=DPCode.SWITCH_3,
|
||||
translation_key="switch_3",
|
||||
translation_key="indexed_switch",
|
||||
translation_placeholders={"index": "3"},
|
||||
),
|
||||
SwitchEntityDescription(
|
||||
key=DPCode.SWITCH_4,
|
||||
translation_key="switch_4",
|
||||
translation_key="indexed_switch",
|
||||
translation_placeholders={"index": "4"},
|
||||
),
|
||||
SwitchEntityDescription(
|
||||
key=DPCode.SWITCH_5,
|
||||
translation_key="switch_5",
|
||||
translation_key="indexed_switch",
|
||||
translation_placeholders={"index": "5"},
|
||||
),
|
||||
SwitchEntityDescription(
|
||||
key=DPCode.SWITCH_6,
|
||||
translation_key="switch_6",
|
||||
translation_key="indexed_switch",
|
||||
translation_placeholders={"index": "6"},
|
||||
),
|
||||
SwitchEntityDescription(
|
||||
key=DPCode.SWITCH_7,
|
||||
translation_key="switch_7",
|
||||
translation_key="indexed_switch",
|
||||
translation_placeholders={"index": "7"},
|
||||
),
|
||||
SwitchEntityDescription(
|
||||
key=DPCode.SWITCH_8,
|
||||
translation_key="switch_8",
|
||||
translation_key="indexed_switch",
|
||||
translation_placeholders={"index": "8"},
|
||||
),
|
||||
),
|
||||
# Wake Up Light II
|
||||
@ -272,22 +280,26 @@ SWITCHES: dict[str, tuple[SwitchEntityDescription, ...]] = {
|
||||
),
|
||||
SwitchEntityDescription(
|
||||
key=DPCode.SWITCH_2,
|
||||
translation_key="alarm_1",
|
||||
translation_key="indexed_alarm",
|
||||
translation_placeholders={"index": "1"},
|
||||
entity_category=EntityCategory.CONFIG,
|
||||
),
|
||||
SwitchEntityDescription(
|
||||
key=DPCode.SWITCH_3,
|
||||
translation_key="alarm_2",
|
||||
translation_key="indexed_alarm",
|
||||
translation_placeholders={"index": "2"},
|
||||
entity_category=EntityCategory.CONFIG,
|
||||
),
|
||||
SwitchEntityDescription(
|
||||
key=DPCode.SWITCH_4,
|
||||
translation_key="alarm_3",
|
||||
translation_key="indexed_alarm",
|
||||
translation_placeholders={"index": "3"},
|
||||
entity_category=EntityCategory.CONFIG,
|
||||
),
|
||||
SwitchEntityDescription(
|
||||
key=DPCode.SWITCH_5,
|
||||
translation_key="alarm_4",
|
||||
translation_key="indexed_alarm",
|
||||
translation_placeholders={"index": "4"},
|
||||
entity_category=EntityCategory.CONFIG,
|
||||
),
|
||||
SwitchEntityDescription(
|
||||
@ -324,67 +336,81 @@ SWITCHES: dict[str, tuple[SwitchEntityDescription, ...]] = {
|
||||
),
|
||||
SwitchEntityDescription(
|
||||
key=DPCode.SWITCH_1,
|
||||
translation_key="switch_1",
|
||||
translation_key="indexed_switch",
|
||||
translation_placeholders={"index": "1"},
|
||||
device_class=SwitchDeviceClass.OUTLET,
|
||||
),
|
||||
SwitchEntityDescription(
|
||||
key=DPCode.SWITCH_2,
|
||||
translation_key="switch_2",
|
||||
translation_key="indexed_switch",
|
||||
translation_placeholders={"index": "2"},
|
||||
device_class=SwitchDeviceClass.OUTLET,
|
||||
),
|
||||
SwitchEntityDescription(
|
||||
key=DPCode.SWITCH_3,
|
||||
translation_key="switch_3",
|
||||
translation_key="indexed_switch",
|
||||
translation_placeholders={"index": "3"},
|
||||
device_class=SwitchDeviceClass.OUTLET,
|
||||
),
|
||||
SwitchEntityDescription(
|
||||
key=DPCode.SWITCH_4,
|
||||
translation_key="switch_4",
|
||||
translation_key="indexed_switch",
|
||||
translation_placeholders={"index": "4"},
|
||||
device_class=SwitchDeviceClass.OUTLET,
|
||||
),
|
||||
SwitchEntityDescription(
|
||||
key=DPCode.SWITCH_5,
|
||||
translation_key="switch_5",
|
||||
translation_key="indexed_switch",
|
||||
translation_placeholders={"index": "5"},
|
||||
device_class=SwitchDeviceClass.OUTLET,
|
||||
),
|
||||
SwitchEntityDescription(
|
||||
key=DPCode.SWITCH_6,
|
||||
translation_key="switch_6",
|
||||
translation_key="indexed_switch",
|
||||
translation_placeholders={"index": "6"},
|
||||
device_class=SwitchDeviceClass.OUTLET,
|
||||
),
|
||||
SwitchEntityDescription(
|
||||
key=DPCode.SWITCH_7,
|
||||
translation_key="switch_7",
|
||||
translation_key="indexed_switch",
|
||||
translation_placeholders={"index": "7"},
|
||||
device_class=SwitchDeviceClass.OUTLET,
|
||||
),
|
||||
SwitchEntityDescription(
|
||||
key=DPCode.SWITCH_8,
|
||||
translation_key="switch_8",
|
||||
translation_key="indexed_switch",
|
||||
translation_placeholders={"index": "8"},
|
||||
device_class=SwitchDeviceClass.OUTLET,
|
||||
),
|
||||
SwitchEntityDescription(
|
||||
key=DPCode.SWITCH_USB1,
|
||||
translation_key="usb_1",
|
||||
translation_key="indexed_usb",
|
||||
translation_placeholders={"index": "1"},
|
||||
),
|
||||
SwitchEntityDescription(
|
||||
key=DPCode.SWITCH_USB2,
|
||||
translation_key="usb_2",
|
||||
translation_key="indexed_usb",
|
||||
translation_placeholders={"index": "2"},
|
||||
),
|
||||
SwitchEntityDescription(
|
||||
key=DPCode.SWITCH_USB3,
|
||||
translation_key="usb_3",
|
||||
translation_key="indexed_usb",
|
||||
translation_placeholders={"index": "3"},
|
||||
),
|
||||
SwitchEntityDescription(
|
||||
key=DPCode.SWITCH_USB4,
|
||||
translation_key="usb_4",
|
||||
translation_key="indexed_usb",
|
||||
translation_placeholders={"index": "4"},
|
||||
),
|
||||
SwitchEntityDescription(
|
||||
key=DPCode.SWITCH_USB5,
|
||||
translation_key="usb_5",
|
||||
translation_key="indexed_usb",
|
||||
translation_placeholders={"index": "5"},
|
||||
),
|
||||
SwitchEntityDescription(
|
||||
key=DPCode.SWITCH_USB6,
|
||||
translation_key="usb_6",
|
||||
translation_key="indexed_usb",
|
||||
translation_placeholders={"index": "6"},
|
||||
),
|
||||
SwitchEntityDescription(
|
||||
key=DPCode.SWITCH,
|
||||
@ -487,57 +513,69 @@ SWITCHES: dict[str, tuple[SwitchEntityDescription, ...]] = {
|
||||
),
|
||||
SwitchEntityDescription(
|
||||
key=DPCode.SWITCH_1,
|
||||
translation_key="socket_1",
|
||||
translation_key="indexed_socket",
|
||||
translation_placeholders={"index": "1"},
|
||||
device_class=SwitchDeviceClass.OUTLET,
|
||||
),
|
||||
SwitchEntityDescription(
|
||||
key=DPCode.SWITCH_2,
|
||||
translation_key="socket_2",
|
||||
translation_key="indexed_socket",
|
||||
translation_placeholders={"index": "2"},
|
||||
device_class=SwitchDeviceClass.OUTLET,
|
||||
),
|
||||
SwitchEntityDescription(
|
||||
key=DPCode.SWITCH_3,
|
||||
translation_key="socket_3",
|
||||
translation_key="indexed_socket",
|
||||
translation_placeholders={"index": "3"},
|
||||
device_class=SwitchDeviceClass.OUTLET,
|
||||
),
|
||||
SwitchEntityDescription(
|
||||
key=DPCode.SWITCH_4,
|
||||
translation_key="socket_4",
|
||||
translation_key="indexed_socket",
|
||||
translation_placeholders={"index": "4"},
|
||||
device_class=SwitchDeviceClass.OUTLET,
|
||||
),
|
||||
SwitchEntityDescription(
|
||||
key=DPCode.SWITCH_5,
|
||||
translation_key="socket_5",
|
||||
translation_key="indexed_socket",
|
||||
translation_placeholders={"index": "5"},
|
||||
device_class=SwitchDeviceClass.OUTLET,
|
||||
),
|
||||
SwitchEntityDescription(
|
||||
key=DPCode.SWITCH_6,
|
||||
translation_key="socket_6",
|
||||
translation_key="indexed_socket",
|
||||
translation_placeholders={"index": "6"},
|
||||
device_class=SwitchDeviceClass.OUTLET,
|
||||
),
|
||||
SwitchEntityDescription(
|
||||
key=DPCode.SWITCH_USB1,
|
||||
translation_key="usb_1",
|
||||
translation_key="indexed_usb",
|
||||
translation_placeholders={"index": "1"},
|
||||
),
|
||||
SwitchEntityDescription(
|
||||
key=DPCode.SWITCH_USB2,
|
||||
translation_key="usb_2",
|
||||
translation_key="indexed_usb",
|
||||
translation_placeholders={"index": "2"},
|
||||
),
|
||||
SwitchEntityDescription(
|
||||
key=DPCode.SWITCH_USB3,
|
||||
translation_key="usb_3",
|
||||
translation_key="indexed_usb",
|
||||
translation_placeholders={"index": "3"},
|
||||
),
|
||||
SwitchEntityDescription(
|
||||
key=DPCode.SWITCH_USB4,
|
||||
translation_key="usb_4",
|
||||
translation_key="indexed_usb",
|
||||
translation_placeholders={"index": "4"},
|
||||
),
|
||||
SwitchEntityDescription(
|
||||
key=DPCode.SWITCH_USB5,
|
||||
translation_key="usb_5",
|
||||
translation_key="indexed_usb",
|
||||
translation_placeholders={"index": "5"},
|
||||
),
|
||||
SwitchEntityDescription(
|
||||
key=DPCode.SWITCH_USB6,
|
||||
translation_key="usb_6",
|
||||
translation_key="indexed_usb",
|
||||
translation_placeholders={"index": "6"},
|
||||
),
|
||||
SwitchEntityDescription(
|
||||
key=DPCode.SWITCH,
|
||||
@ -698,22 +736,26 @@ SWITCHES: dict[str, tuple[SwitchEntityDescription, ...]] = {
|
||||
"tdq": (
|
||||
SwitchEntityDescription(
|
||||
key=DPCode.SWITCH_1,
|
||||
translation_key="switch_1",
|
||||
translation_key="indexed_switch",
|
||||
translation_placeholders={"index": "1"},
|
||||
device_class=SwitchDeviceClass.OUTLET,
|
||||
),
|
||||
SwitchEntityDescription(
|
||||
key=DPCode.SWITCH_2,
|
||||
translation_key="switch_2",
|
||||
translation_key="indexed_switch",
|
||||
translation_placeholders={"index": "2"},
|
||||
device_class=SwitchDeviceClass.OUTLET,
|
||||
),
|
||||
SwitchEntityDescription(
|
||||
key=DPCode.SWITCH_3,
|
||||
translation_key="switch_3",
|
||||
translation_key="indexed_switch",
|
||||
translation_placeholders={"index": "3"},
|
||||
device_class=SwitchDeviceClass.OUTLET,
|
||||
),
|
||||
SwitchEntityDescription(
|
||||
key=DPCode.SWITCH_4,
|
||||
translation_key="switch_4",
|
||||
translation_key="indexed_switch",
|
||||
translation_placeholders={"index": "4"},
|
||||
device_class=SwitchDeviceClass.OUTLET,
|
||||
),
|
||||
SwitchEntityDescription(
|
||||
@ -746,12 +788,14 @@ SWITCHES: dict[str, tuple[SwitchEntityDescription, ...]] = {
|
||||
"wkcz": (
|
||||
SwitchEntityDescription(
|
||||
key=DPCode.SWITCH_1,
|
||||
translation_key="switch_1",
|
||||
translation_key="indexed_switch",
|
||||
translation_placeholders={"index": "1"},
|
||||
device_class=SwitchDeviceClass.OUTLET,
|
||||
),
|
||||
SwitchEntityDescription(
|
||||
key=DPCode.SWITCH_2,
|
||||
translation_key="switch_2",
|
||||
translation_key="indexed_switch",
|
||||
translation_placeholders={"index": "2"},
|
||||
device_class=SwitchDeviceClass.OUTLET,
|
||||
),
|
||||
),
|
||||
|
@ -464,7 +464,7 @@
|
||||
'previous_unique_id': None,
|
||||
'suggested_object_id': None,
|
||||
'supported_features': 0,
|
||||
'translation_key': 'socket_1',
|
||||
'translation_key': 'indexed_socket',
|
||||
'unique_id': 'tuya.eb0c772dabbb19d653ssi5switch_1',
|
||||
'unit_of_measurement': None,
|
||||
})
|
||||
@ -513,7 +513,7 @@
|
||||
'previous_unique_id': None,
|
||||
'suggested_object_id': None,
|
||||
'supported_features': 0,
|
||||
'translation_key': 'socket_2',
|
||||
'translation_key': 'indexed_socket',
|
||||
'unique_id': 'tuya.eb0c772dabbb19d653ssi5switch_2',
|
||||
'unit_of_measurement': None,
|
||||
})
|
||||
@ -658,7 +658,7 @@
|
||||
'previous_unique_id': None,
|
||||
'suggested_object_id': None,
|
||||
'supported_features': 0,
|
||||
'translation_key': 'switch_1',
|
||||
'translation_key': 'indexed_switch',
|
||||
'unique_id': 'tuya.0665305284f3ebe9fdc1switch_1',
|
||||
'unit_of_measurement': None,
|
||||
})
|
||||
@ -995,7 +995,7 @@
|
||||
'previous_unique_id': None,
|
||||
'suggested_object_id': None,
|
||||
'supported_features': 0,
|
||||
'translation_key': 'switch_1',
|
||||
'translation_key': 'indexed_switch',
|
||||
'unique_id': 'tuya.bf082711d275c0c883vb4pswitch_1',
|
||||
'unit_of_measurement': None,
|
||||
})
|
||||
@ -1044,7 +1044,7 @@
|
||||
'previous_unique_id': None,
|
||||
'suggested_object_id': None,
|
||||
'supported_features': 0,
|
||||
'translation_key': 'switch_2',
|
||||
'translation_key': 'indexed_switch',
|
||||
'unique_id': 'tuya.bf082711d275c0c883vb4pswitch_2',
|
||||
'unit_of_measurement': None,
|
||||
})
|
||||
@ -1093,7 +1093,7 @@
|
||||
'previous_unique_id': None,
|
||||
'suggested_object_id': None,
|
||||
'supported_features': 0,
|
||||
'translation_key': 'switch_3',
|
||||
'translation_key': 'indexed_switch',
|
||||
'unique_id': 'tuya.bf082711d275c0c883vb4pswitch_3',
|
||||
'unit_of_measurement': None,
|
||||
})
|
||||
@ -1142,7 +1142,7 @@
|
||||
'previous_unique_id': None,
|
||||
'suggested_object_id': None,
|
||||
'supported_features': 0,
|
||||
'translation_key': 'switch_4',
|
||||
'translation_key': 'indexed_switch',
|
||||
'unique_id': 'tuya.bf082711d275c0c883vb4pswitch_4',
|
||||
'unit_of_measurement': None,
|
||||
})
|
||||
|
Loading…
x
Reference in New Issue
Block a user