mirror of
https://github.com/house-of-abbey/GarminHomeAssistant.git
synced 2025-04-29 20:22:52 +00:00
Update HomeAssistantApp.mc
Update the Settings object from persistent storage before checking the URLs work and reporting the status to the Glance view.
This commit is contained in:
@ -212,7 +212,7 @@ class HomeAssistantApp extends Application.AppBase {
|
||||
// asynchronous and affects how the views are managed.
|
||||
(:glance)
|
||||
function fetchMenuConfig() as Lang.Boolean {
|
||||
// System.println("URL = " + Settings.getConfigUrl());
|
||||
// System.println("Menu URL = " + Settings.getConfigUrl());
|
||||
if (Settings.getConfigUrl().equals("")) {
|
||||
mMenuStatus = WatchUi.loadResource($.Rez.Strings.Unconfigured) as Lang.String;
|
||||
WatchUi.requestUpdate();
|
||||
@ -468,6 +468,7 @@ class HomeAssistantApp extends Application.AppBase {
|
||||
|
||||
(:glance)
|
||||
function fetchApiStatus() as Void {
|
||||
// System.println("API URL = " + Settings.getApiUrl());
|
||||
if (Settings.getApiUrl().equals("")) {
|
||||
mApiStatus = WatchUi.loadResource($.Rez.Strings.Unconfigured) as Lang.String;
|
||||
WatchUi.requestUpdate();
|
||||
@ -546,8 +547,8 @@ class HomeAssistantApp extends Application.AppBase {
|
||||
mIsGlance = true;
|
||||
mApiStatus = WatchUi.loadResource($.Rez.Strings.Checking) as Lang.String;
|
||||
mMenuStatus = WatchUi.loadResource($.Rez.Strings.Checking) as Lang.String;
|
||||
updateStatus();
|
||||
Settings.update();
|
||||
updateStatus();
|
||||
mGlanceTimer = new Timer.Timer();
|
||||
mGlanceTimer.start(method(:updateStatus), Globals.scApiBackoff, true);
|
||||
return [new HomeAssistantGlanceView(self)];
|
||||
|
Reference in New Issue
Block a user