Skip to content

Commit

Permalink
Check for numeric state
Browse files Browse the repository at this point in the history
  • Loading branch information
piitaya committed Oct 23, 2023
1 parent ddc9a73 commit 46026fa
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/panels/lovelace/common/validate-condition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@ function checkStateNumericCondition(
}

const numericState = Number(entity.state);

if (isNaN(numericState)) {
return false;
}

return (
(condition.above == null || condition.above < numericState) &&
(condition.below == null || condition.below >= numericState)
Expand Down

0 comments on commit 46026fa

Please sign in to comment.