Merge condition to set the entity to filter on

Co-authored-by: Paul Bottein <paul.bottein@gmail.com>
This commit is contained in:
Quentame 2024-01-22 18:52:53 +01:00 committed by Quentin POLLET
parent 2c91e2dbc7
commit 69310d2d45

View File

@ -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;