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 "!=": 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": {