From c5d617477fd47118964a8130c91fb9e3a6489779 Mon Sep 17 00:00:00 2001 From: Yegor Vialov Date: Thu, 12 Mar 2020 21:19:39 +0000 Subject: [PATCH] Fix state filter when state is number --- lib/cards/card.class.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/cards/card.class.dart b/lib/cards/card.class.dart index ca05f59..71db7b2 100644 --- a/lib/cards/card.class.dart +++ b/lib/cards/card.class.dart @@ -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;