Fix state filter when state is number

This commit is contained in:
Yegor Vialov
2020-03-12 21:19:39 +00:00
parent 244a1984cc
commit c5d617477f

View File

@ -66,7 +66,7 @@ class HACard {
var tmpVal = allowedState['attribute'] != null ? entityWrapper.entity.getAttribute(allowedState['attribute']) : entityWrapper.entity.state;
var valToCompareWith = allowedState['value'];
var valToCompare;
if (valToCompareWith is! String) {
if (valToCompareWith is! String && tmpVal is String) {
valToCompare = double.tryParse(tmpVal);
} else {
valToCompare = tmpVal;