From 3d03f74d6604623cbf55556b6ba413745a0e9d9b Mon Sep 17 00:00:00 2001 From: karwosts <32912880+karwosts@users.noreply.github.com> Date: Mon, 6 Nov 2023 01:04:58 -0800 Subject: [PATCH] Improve template trigger/condition descriptions (#18504) --- src/data/automation_i18n.ts | 6 ++++++ src/translations/en.json | 7 +++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/data/automation_i18n.ts b/src/data/automation_i18n.ts index 6e18baeef085..3e6656d5d8fe 100644 --- a/src/data/automation_i18n.ts +++ b/src/data/automation_i18n.ts @@ -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`, diff --git a/src/translations/en.json b/src/translations/en.json index 7ec2605437f5..907445f5b42a 100644 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -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": { @@ -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%]",