mirror of
https://github.com/home-assistant/frontend.git
synced 2025-08-02 14:07:55 +00:00
Improve check
This commit is contained in:
parent
f5e6a65a37
commit
458cbd9c1f
@ -178,10 +178,16 @@ export function extractConditionEntityIds(conditions: Condition[]): string[] {
|
|||||||
const entityIds: string[] = [];
|
const entityIds: string[] = [];
|
||||||
for (const condition of conditions) {
|
for (const condition of conditions) {
|
||||||
if (condition.condition === "numeric_state") {
|
if (condition.condition === "numeric_state") {
|
||||||
if (typeof condition.above === "string") {
|
if (
|
||||||
|
typeof condition.above === "string" &&
|
||||||
|
isValidEntityId(condition.above)
|
||||||
|
) {
|
||||||
entityIds.push(condition.above);
|
entityIds.push(condition.above);
|
||||||
}
|
}
|
||||||
if (typeof condition.below === "string") {
|
if (
|
||||||
|
typeof condition.below === "string" &&
|
||||||
|
isValidEntityId(condition.below)
|
||||||
|
) {
|
||||||
entityIds.push(condition.below);
|
entityIds.push(condition.below);
|
||||||
}
|
}
|
||||||
} else if ("conditions" in condition && condition.conditions) {
|
} else if ("conditions" in condition && condition.conditions) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user