From 1262d8c9aa1015cf52dd1f3969e15a644ff6d5c2 Mon Sep 17 00:00:00 2001 From: Yegor Vialov Date: Fri, 8 Nov 2019 20:41:51 +0000 Subject: [PATCH] Resolves #484 Fix entity-filter cards --- lib/home_assistant.class.dart | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/home_assistant.class.dart b/lib/home_assistant.class.dart index 2776c1c..77574b7 100644 --- a/lib/home_assistant.class.dart +++ b/lib/home_assistant.class.dart @@ -218,6 +218,9 @@ class HomeAssistant { try { //bool isThereCardOptionsInside = rawCard["card"] != null; var rawCardInfo = rawCard["card"] ?? rawCard; + if (rawCardInfo['state_filter'] != null) { + Logger.d("Hey!!!!!! We found a card with state filter: ${rawCardInfo['state_filter']}"); + } HACard card = HACard( id: "card", name: rawCardInfo["title"] ?? rawCardInfo["name"], @@ -226,7 +229,7 @@ class HomeAssistant { showName: rawCardInfo['show_name'] ?? true, showState: rawCardInfo['show_state'] ?? true, showEmpty: rawCardInfo['show_empty'] ?? true, - stateFilter: rawCardInfo['state_filter'] ?? [], + stateFilter: (rawCard['state_filter'] ?? rawCardInfo['state_filter']) ?? [], states: rawCardInfo['states'], conditions: rawCard['conditions'] ?? [], content: rawCardInfo['content'],