From 69310d2d4593455b9e5771c9c7c336095ed78a9d Mon Sep 17 00:00:00 2001 From: Quentame Date: Mon, 22 Jan 2024 18:52:53 +0100 Subject: [PATCH] Merge condition to set the entity to filter on Co-authored-by: Paul Bottein --- src/panels/lovelace/common/validate-condition.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/panels/lovelace/common/validate-condition.ts b/src/panels/lovelace/common/validate-condition.ts index 4606916cfb..ac86fed600 100644 --- a/src/panels/lovelace/common/validate-condition.ts +++ b/src/panels/lovelace/common/validate-condition.ts @@ -258,13 +258,12 @@ export function buildConditionForFilter( // Set the entity to filter on if ( - "condition" in newCondition && - (newCondition.condition === "numeric_state" || - newCondition.condition === "state") + ("condition" in newCondition && + (newCondition.condition === "numeric_state" || + newCondition.condition === "state")) || + "operator" in newCondition ) { newCondition.entity = entityId; - } else if ("operator" in newCondition) { - newCondition.entity = entityId; } return newCondition;