Resolves #472 entity-filter fix

This commit is contained in:
estevez-dev 2019-09-30 21:21:16 +03:00
parent 96fa7ece25
commit a4477e9f83

View File

@ -217,7 +217,8 @@ class HomeAssistant {
if (rawCardInfo["cards"] != null) { if (rawCardInfo["cards"] != null) {
card.childCards = _createLovelaceCards(rawCardInfo["cards"]); card.childCards = _createLovelaceCards(rawCardInfo["cards"]);
} }
rawCardInfo["entities"]?.forEach((rawEntity) { var rawEntities = rawCard["entities"] ?? rawCardInfo["entities"];
rawEntities?.forEach((rawEntity) {
if (rawEntity is String) { if (rawEntity is String) {
if (entities.isExist(rawEntity)) { if (entities.isExist(rawEntity)) {
card.entities.add(EntityWrapper(entity: entities.get(rawEntity))); card.entities.add(EntityWrapper(entity: entities.get(rawEntity)));
@ -280,8 +281,9 @@ class HomeAssistant {
} }
} }
}); });
if (rawCardInfo["entity"] != null) { var rawSingleEntity = rawCard["entity"] ?? rawCardInfo["entity"];
var en = rawCardInfo["entity"]; if (rawSingleEntity != null) {
var en = rawSingleEntity;
if (en is String) { if (en is String) {
if (entities.isExist(en)) { if (entities.isExist(en)) {
Entity e = entities.get(en); Entity e = entities.get(en);