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;