diff --git a/lib/main.dart b/lib/main.dart index d66396f..90a43db 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -34,7 +34,7 @@ part 'badge_class.dart'; EventBus eventBus = new EventBus(); const String appName = "HA Client"; -const appVersion = "0.2.4"; +const appVersion = "0.2.5"; String homeAssistantWebHost; @@ -100,6 +100,7 @@ class _MainPageState extends State with WidgetsBindingObserver { StreamSubscription _serviceCallSubscription; StreamSubscription _showEntityPageSubscription; bool _isLoading = true; + bool _settingsLoaded = false; Map _badgeColors = { "default": Color.fromRGBO(223, 76, 30, 1.0), @@ -109,6 +110,7 @@ class _MainPageState extends State with WidgetsBindingObserver { @override void initState() { super.initState(); + _settingsLoaded = false; WidgetsBinding.instance.addObserver(this); _homeAssistant = HomeAssistant(); @@ -144,7 +146,7 @@ class _MainPageState extends State with WidgetsBindingObserver { @override void didChangeAppLifecycleState(AppLifecycleState state) { TheLogger.log("Debug","$state"); - if (state == AppLifecycleState.resumed) { + if (state == AppLifecycleState.resumed && _settingsLoaded) { _refreshData(); } } @@ -161,6 +163,8 @@ class _MainPageState extends State with WidgetsBindingObserver { if ((domain == null) || (port == null) || (_apiPassword == null) || (domain.length == 0) || (port.length == 0) || (_apiPassword.length == 0)) { throw("Check connection settings"); + } else { + _settingsLoaded = true; } } diff --git a/pubspec.yaml b/pubspec.yaml index 1b0ea44..acc38a7 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: hass_client description: Home Assistant Android Client -version: 0.2.4+26 +version: 0.2.5+27 environment: sdk: ">=2.0.0-dev.68.0 <3.0.0"