Skip to content

Commit

Permalink
Improve check
Browse files Browse the repository at this point in the history
  • Loading branch information
piitaya committed Mar 12, 2024
1 parent f5e6a65 commit 458cbd9
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/panels/lovelace/common/validate-condition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 458cbd9

Please sign in to comment.