mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-21 08:16:36 +00:00
Fix for NOT IN / IN Operators (#7061)
This commit is contained in:
parent
76db64c073
commit
60133941ae
@ -21,13 +21,13 @@ export const evaluateFilter = (stateObj: HassEntity, filter: any): boolean => {
|
|||||||
case "!=":
|
case "!=":
|
||||||
return state !== value;
|
return state !== value;
|
||||||
case "in":
|
case "in":
|
||||||
if (Array.isArray(state) || typeof state === "string") {
|
if (Array.isArray(value) || typeof value === "string") {
|
||||||
return state.includes(value);
|
return value.includes(state);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
case "not in":
|
case "not in":
|
||||||
if (Array.isArray(state) || typeof state === "string") {
|
if (Array.isArray(value) || typeof value === "string") {
|
||||||
return !state.includes(value);
|
return !value.includes(state);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
case "regex": {
|
case "regex": {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user