Resolves #526 Subscribe to Lovelace update events
This commit is contained in:
@ -49,6 +49,7 @@ class HomeAssistant {
|
||||
|
||||
HomeAssistant._internal() {
|
||||
ConnectionManager().onStateChangeCallback = _handleEntityStateChange;
|
||||
ConnectionManager().onLovelaceUpdatedCallback = _handleLovelaceUpdate;
|
||||
DeviceInfoManager().loadDeviceInfo();
|
||||
}
|
||||
|
||||
@ -296,6 +297,14 @@ class HomeAssistant {
|
||||
return completer.future;
|
||||
}
|
||||
|
||||
void _handleLovelaceUpdate() {
|
||||
if (_fetchCompleter != null && _fetchCompleter.isCompleted) {
|
||||
eventBus.fire(new StateChangedEvent(
|
||||
needToRebuildUI: true
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
void _handleEntityStateChange(Map eventData) {
|
||||
//TheLogger.debug( "New state for ${eventData['entity_id']}");
|
||||
if (_fetchCompleter != null && _fetchCompleter.isCompleted) {
|
||||
|
Reference in New Issue
Block a user