entity-filter card allow state_filter.value == 0 (number 0) (#8225)

This commit is contained in:
b3nj1 2021-01-25 01:54:22 -08:00 committed by GitHub
parent 748a05f355
commit a6b77c0457
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2,7 +2,7 @@ import { HassEntity } from "home-assistant-js-websocket";
export const evaluateFilter = (stateObj: HassEntity, filter: any): boolean => {
const operator = filter.operator || "==";
const value = filter.value || filter;
const value = filter.value ?? filter;
const state = filter.attribute
? stateObj.attributes[filter.attribute]
: stateObj.state;