zha_map WIP: get inital data

This commit is contained in:
Yegor Vialov
2020-04-01 17:04:32 +00:00
parent 2f517a3ad5
commit 293b5e0242
5 changed files with 113 additions and 2 deletions

View File

@ -317,10 +317,27 @@ class HomeAssistant {
}
}
bool isServiceExist(String service) {
return services != null &&
services.isNotEmpty &&
services.containsKey(service);
}
void _createUI() {
if (!autoUi && (_rawLovelaceData != null)) {
Logger.d("Creating Lovelace UI");
ui = HomeAssistantUI(_rawLovelaceData);
if (isServiceExist('zha_map')) {
panels.add(
Panel(
id: 'haclient_zha',
componentName: 'haclient_zha',
title: 'ZHA',
urlPath: '/haclient_zha',
icon: 'mdi:zigbee'
)
);
}
} else {
Logger.e("No lovelace config!!!!");
}