Fix for NOT IN / IN Operators (#7061)

This commit is contained in:
b3nj1 2020-09-21 05:05:28 -07:00 committed by GitHub
parent 76db64c073
commit 60133941ae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -21,13 +21,13 @@ export const evaluateFilter = (stateObj: HassEntity, filter: any): boolean => {
case "!=":
return state !== value;
case "in":
if (Array.isArray(state) || typeof state === "string") {
return state.includes(value);
if (Array.isArray(value) || typeof value === "string") {
return value.includes(state);
}
return false;
case "not in":
if (Array.isArray(state) || typeof state === "string") {
return !state.includes(value);
if (Array.isArray(value) || typeof value === "string") {
return !value.includes(state);
}
return false;
case "regex": {