From c54acc936992de581f5924203c857cbd1a0553ed Mon Sep 17 00:00:00 2001 From: koostamas Date: Mon, 10 Jun 2024 19:19:26 +0200 Subject: [PATCH] Fix automation describeCondition for number state type (#21052) When using a number state condition in an automation, the UI used an incorrect evaluation when trying to describe the condition which made the label default to the default value. To fix this, I just changed the evaluation to check directly for `undefined` value. --- src/data/automation_i18n.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/data/automation_i18n.ts b/src/data/automation_i18n.ts index f1a3077acc76..908c37954cbf 100644 --- a/src/data/automation_i18n.ts +++ b/src/data/automation_i18n.ts @@ -901,7 +901,7 @@ const tryDescribeCondition = ( ) : undefined; - if (condition.above && condition.below) { + if (condition.above !== undefined && condition.below !== undefined) { return hass.localize( `${conditionsTranslationBaseKey}.numeric_state.description.above-below`, { @@ -912,7 +912,7 @@ const tryDescribeCondition = ( } ); } - if (condition.above) { + if (condition.above !== undefined) { return hass.localize( `${conditionsTranslationBaseKey}.numeric_state.description.above`, { @@ -922,7 +922,7 @@ const tryDescribeCondition = ( } ); } - if (condition.below) { + if (condition.below !== undefined) { return hass.localize( `${conditionsTranslationBaseKey}.numeric_state.description.below`, {