Skip to content

Commit

Permalink
Improve template trigger/condition descriptions (home-assistant#18504)
Browse files Browse the repository at this point in the history
  • Loading branch information
karwosts authored Nov 6, 2023
1 parent e09a6a2 commit 3d03f74
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
6 changes: 6 additions & 0 deletions src/data/automation_i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1090,6 +1090,12 @@ const tryDescribeCondition = (
}`;
}

if (condition.condition === "template") {
return hass.localize(
`${conditionsTranslationBaseKey}.template.description.full`
);
}

if (condition.condition === "trigger" && condition.id != null) {
return hass.localize(
`${conditionsTranslationBaseKey}.trigger.description.full`,
Expand Down
7 changes: 5 additions & 2 deletions src/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -2532,7 +2532,7 @@
"value_template": "Value template",
"for": "For",
"description": {
"full": "When a template triggers{hasDuration, select, \n true { for {duration}} \n other {}\n }"
"full": "When a template changes from false to true{hasDuration, select, \n true { for {duration}} \n other {}\n }"
}
},
"time": {
Expand Down Expand Up @@ -2662,7 +2662,10 @@
},
"template": {
"label": "[%key:ui::panel::config::automation::editor::triggers::type::template::label%]",
"value_template": "[%key:ui::panel::config::automation::editor::triggers::type::template::value_template%]"
"value_template": "[%key:ui::panel::config::automation::editor::triggers::type::template::value_template%]",
"description": {
"full": "Test if template renders a value equal to true"
}
},
"time": {
"type_value": "[%key:ui::panel::config::automation::editor::triggers::type::time::type_value%]",
Expand Down

0 comments on commit 3d03f74

Please sign in to comment.