Translation support for device automation extra fields (#115892)

* Translation support for device trigger extra fields

* Move extra_fields translations to backend
This commit is contained in:
Matthias Alphart 2024-06-12 14:10:02 +02:00 committed by GitHub
parent 8ca0de1d20
commit 171707e8b7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
17 changed files with 78 additions and 0 deletions

View File

@ -17,6 +17,10 @@
"is_armed_night": "{entity_name} is armed night",
"is_armed_vacation": "{entity_name} is armed vacation"
},
"extra_fields": {
"code": "Code",
"for": "[%key:common::device_automation::extra_fields::for%]"
},
"trigger_type": {
"triggered": "{entity_name} triggered",
"disarmed": "{entity_name} disarmed",

View File

@ -55,6 +55,9 @@
"is_on": "[%key:common::device_automation::condition_type::is_on%]",
"is_off": "[%key:common::device_automation::condition_type::is_off%]"
},
"extra_fields": {
"for": "[%key:common::device_automation::extra_fields::for%]"
},
"trigger_type": {
"bat_low": "{entity_name} battery low",
"not_bat_low": "{entity_name} battery normal",

View File

@ -13,6 +13,14 @@
"action_type": {
"set_hvac_mode": "Change HVAC mode on {entity_name}",
"set_preset_mode": "Change preset on {entity_name}"
},
"extra_fields": {
"above": "[%key:common::device_automation::extra_fields::above%]",
"below": "[%key:common::device_automation::extra_fields::below%]",
"for": "[%key:common::device_automation::extra_fields::for%]",
"to": "[%key:common::device_automation::extra_fields::to%]",
"preset_mode": "Preset mode",
"hvac_mode": "HVAC mode"
}
},
"entity_component": {

View File

@ -18,6 +18,12 @@
"is_position": "Current {entity_name} position is",
"is_tilt_position": "Current {entity_name} tilt position is"
},
"extra_fields": {
"above": "[%key:common::device_automation::extra_fields::above%]",
"below": "[%key:common::device_automation::extra_fields::below%]",
"for": "[%key:common::device_automation::extra_fields::for%]",
"position": "Position"
},
"trigger_type": {
"opened": "{entity_name} opened",
"closed": "{entity_name} closed",

View File

@ -5,6 +5,9 @@
"is_home": "{entity_name} is home",
"is_not_home": "{entity_name} is not home"
},
"extra_fields": {
"zone": "[%key:common::device_automation::extra_fields::zone%]"
},
"trigger_type": {
"enters": "{entity_name} enters a zone",
"leaves": "{entity_name} leaves a zone"

View File

@ -18,6 +18,13 @@
"toggle": "[%key:common::device_automation::action_type::toggle%]",
"turn_on": "[%key:common::device_automation::action_type::turn_on%]",
"turn_off": "[%key:common::device_automation::action_type::turn_off%]"
},
"extra_fields": {
"above": "[%key:common::device_automation::extra_fields::above%]",
"below": "[%key:common::device_automation::extra_fields::below%]",
"for": "[%key:common::device_automation::extra_fields::for%]",
"mode": "Mode",
"humidity": "Humidity"
}
},
"entity_component": {

View File

@ -53,6 +53,10 @@
"changed_states": "[%key:common::device_automation::trigger_type::changed_states%]",
"turned_on": "[%key:common::device_automation::trigger_type::turned_on%]",
"turned_off": "[%key:common::device_automation::trigger_type::turned_off%]"
},
"extra_fields": {
"brightness_pct": "Brightness",
"flash": "Flash"
}
},
"entity_component": {

View File

@ -15,6 +15,9 @@
"locked": "{entity_name} locked",
"unlocked": "{entity_name} unlocked",
"open": "{entity_name} opened"
},
"extra_fields": {
"for": "[%key:common::device_automation::extra_fields::for%]"
}
},
"entity_component": {

View File

@ -17,6 +17,9 @@
"paused": "{entity_name} is paused",
"playing": "{entity_name} starts playing",
"changed_states": "[%key:common::device_automation::trigger_type::changed_states%]"
},
"extra_fields": {
"for": "[%key:common::device_automation::extra_fields::for%]"
}
},
"entity_component": {

View File

@ -13,6 +13,10 @@
"device_automation": {
"action_type": {
"notify": "Send a notification"
},
"extra_fields": {
"message": "Message",
"title": "Title"
}
}
}

View File

@ -3,6 +3,9 @@
"device_automation": {
"action_type": {
"set_value": "Set value for {entity_name}"
},
"extra_fields": {
"value": "[%key:common::device_automation::extra_fields::value%]"
}
},
"entity_component": {

View File

@ -13,6 +13,13 @@
},
"condition_type": {
"selected_option": "Current {entity_name} selected option"
},
"extra_fields": {
"for": "[%key:common::device_automation::extra_fields::for%]",
"to": "[%key:common::device_automation::extra_fields::to%]",
"cycle": "Cycle",
"from": "From",
"option": "Option"
}
},
"entity_component": {

View File

@ -98,6 +98,11 @@
"water": "{entity_name} water changes",
"weight": "{entity_name} weight changes",
"wind_speed": "{entity_name} wind speed changes"
},
"extra_fields": {
"above": "[%key:common::device_automation::extra_fields::above%]",
"below": "[%key:common::device_automation::extra_fields::below%]",
"for": "[%key:common::device_automation::extra_fields::for%]"
}
},
"entity_component": {

View File

@ -3,6 +3,9 @@
"device_automation": {
"action_type": {
"set_value": "Set value for {entity_name}"
},
"extra_fields": {
"value": "[%key:common::device_automation::extra_fields::value%]"
}
},
"entity_component": {

View File

@ -12,6 +12,9 @@
"action_type": {
"clean": "Let {entity_name} clean",
"dock": "Let {entity_name} return to the dock"
},
"extra_fields": {
"for": "[%key:common::device_automation::extra_fields::for%]"
}
},
"entity_component": {

View File

@ -9,6 +9,14 @@
"is_on": "{entity_name} is on",
"is_off": "{entity_name} is off"
},
"extra_fields": {
"above": "Above",
"below": "Below",
"for": "Duration",
"to": "To",
"value": "Value",
"zone": "Zone"
},
"trigger_type": {
"changed_states": "{entity_name} turned on or off",
"turned_on": "{entity_name} turned on",

View File

@ -284,6 +284,10 @@ def gen_strings_schema(config: Config, integration: Integration) -> vol.Schema:
vol.Optional("condition_type"): {str: translation_value_validator},
vol.Optional("trigger_type"): {str: translation_value_validator},
vol.Optional("trigger_subtype"): {str: translation_value_validator},
vol.Optional("extra_fields"): {str: translation_value_validator},
vol.Optional("extra_fields_descriptions"): {
str: translation_value_validator
},
},
vol.Optional("system_health"): {
vol.Optional("info"): cv.schema_with_slug_keys(