You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|`device_automation`| Translations for device automations. |
@@ -22,6 +23,7 @@ The `strings.json` contains translations for different things that the integrati
22
23
|`options`| Translations for the options flow. |
23
24
|`selectors`| Selectors of the integration. |
24
25
|`services`| Service actions of the integration. |
26
+
|`triggers`| Triggers of the integration. |
25
27
26
28
### Title
27
29
@@ -250,6 +252,60 @@ The translation strings for device automations are defined under the `device_aut
250
252
251
253
```
252
254
255
+
### Triggers
256
+
257
+
The translations of trigger strings are defined under the `triggers` key. The structure follows the same format as [service actions](#service-actions): each trigger is keyed by its trigger key (the key returned by `async_get_triggers`) and supports translating the `name` and `description` of the trigger, the `name` and `description` of each of the trigger's `fields`, and the `name` and `description` of each collapsible `section` of fields.
258
+
259
+
The structure of a trigger (its fields, sections and selectors) is defined in the `triggers.yaml` file. See the [Automations](/docs/automations) documentation for more information.
260
+
261
+
```json
262
+
{
263
+
"triggers": {
264
+
"occupancy_cleared": {
265
+
"name": "Occupancy cleared",
266
+
"description": "Triggers when occupancy is cleared.",
267
+
"fields": {
268
+
"for": {
269
+
"name": "For",
270
+
"description": "The duration the occupancy must be cleared before triggering."
271
+
}
272
+
}
273
+
}
274
+
}
275
+
}
276
+
```
277
+
278
+
:::note
279
+
Triggers may use selectors in their `fields`. The translation of those selectors can be provided using the `translation_key` property on the selector definition in the `triggers.yaml` file. See the [Selectors](#selectors) section for more information.
280
+
:::
281
+
282
+
### Conditions
283
+
284
+
The translations of condition strings are defined under the `conditions` key. Just like [triggers](#triggers), the structure follows the same format as [service actions](#service-actions): each condition is keyed by its condition key (the key returned by `async_get_conditions`) and supports translating the `name` and `description` of the condition, the `name` and `description` of each of the condition's `fields`, and the `name` and `description` of each collapsible `section` of fields.
285
+
286
+
The structure of a condition (its fields, sections and selectors) is defined in the `conditions.yaml` file. See the [Automations](/docs/automations) documentation for more information.
287
+
288
+
```json
289
+
{
290
+
"conditions": {
291
+
"door_state": {
292
+
"name": "Door state",
293
+
"description": "Tests if the door has a specific state.",
294
+
"fields": {
295
+
"state": {
296
+
"name": "State",
297
+
"description": "The state the door must have for the condition to pass."
298
+
}
299
+
}
300
+
}
301
+
}
302
+
}
303
+
```
304
+
305
+
:::note
306
+
Conditions may use selectors in their `fields`. The translation of those selectors can be provided using the `translation_key` property on the selector definition in the `conditions.yaml` file. See the [Selectors](#selectors) section for more information.
307
+
:::
308
+
253
309
### Exceptions
254
310
255
311
Localization is supported for `HomeAssistantError` and its subclasses.
0 commit comments