Initial UI generation if no lovelace config

This commit is contained in:
Yegor Vialov
2020-04-02 22:04:56 +00:00
parent d8df32f140
commit d0b7cc1929
6 changed files with 48 additions and 57 deletions

View File

@ -33,7 +33,22 @@ class HomeAssistantUI {
Map result = {};
result['title'] = 'Home';
result['views'] = [
{
'icon': 'mdi:home',
'badges': HomeAssistant().entities.getByDomains(
includeDomains: ['sensor', 'binary_sensor', 'device_tracker', 'person', 'sun']
).map(
(en) => en.entityId
).toList(),
'cards': [{
'type': 'entities',
'entities': HomeAssistant().entities.getByDomains(
excludeDomains: ['sensor','binary_sensor', 'device_tracker', 'person', 'sun']
).map(
(en) => en.entityId
).toList()
}]
}
];
return result;
}