From 458cbd9c1f4fe02c4b68807cd684995b8671609e Mon Sep 17 00:00:00 2001 From: Paul Bottein Date: Tue, 12 Mar 2024 17:59:37 +0100 Subject: [PATCH] Improve check --- src/panels/lovelace/common/validate-condition.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/panels/lovelace/common/validate-condition.ts b/src/panels/lovelace/common/validate-condition.ts index eee8d16d0879..dde1ad3ac91b 100644 --- a/src/panels/lovelace/common/validate-condition.ts +++ b/src/panels/lovelace/common/validate-condition.ts @@ -178,10 +178,16 @@ export function extractConditionEntityIds(conditions: Condition[]): string[] { const entityIds: string[] = []; for (const condition of conditions) { if (condition.condition === "numeric_state") { - if (typeof condition.above === "string") { + if ( + typeof condition.above === "string" && + isValidEntityId(condition.above) + ) { entityIds.push(condition.above); } - if (typeof condition.below === "string") { + if ( + typeof condition.below === "string" && + isValidEntityId(condition.below) + ) { entityIds.push(condition.below); } } else if ("conditions" in condition && condition.conditions) {