Card separation by type

This commit is contained in:
Yegor Vialov
2018-10-27 17:28:47 +03:00
parent 9edfec7dff
commit 809c7d6355
9 changed files with 215 additions and 91 deletions

View File

@ -401,7 +401,8 @@ class HomeAssistant {
TheLogger.debug("------card: ${rawCard['type']}");
HACard card = HACard(
id: "card",
name: rawCard["title"]
name: rawCard["title"],
type: rawCard['type']
);
rawCard["entities"]?.forEach((rawEntity) {
if (rawEntity is String) {
@ -414,6 +415,9 @@ class HomeAssistant {
}
}
});
if (rawCard["entity"] != null) {
card.linkedEntity = entities.get(rawCard["entity"]);
}
result.add(card);
}
});