mirror of
				https://github.com/house-of-abbey/GarminHomeAssistant.git
				synced 2025-10-29 23:08:14 +00:00 
			
		
		
		
	early return from fetchApiStatus for in-app wifi, fix typo in docstrings
This commit is contained in:
		| @@ -575,20 +575,27 @@ class HomeAssistantApp extends Application.AppBase { | ||||
|     // | ||||
|     (:glance) | ||||
|     function fetchApiStatus() as Void { | ||||
|         var phoneConnected = System.getDeviceSettings().phoneConnected; | ||||
|         var connectionAvailable = System.getDeviceSettings().connectionAvailable; | ||||
|  | ||||
|         // System.println("API URL = " + Settings.getApiUrl()); | ||||
|         if (Settings.getApiUrl().equals("")) { | ||||
|             mApiStatus = WatchUi.loadResource($.Rez.Strings.Unconfigured) as Lang.String; | ||||
|             WatchUi.requestUpdate(); | ||||
|         } else { | ||||
|             if (! System.getDeviceSettings().phoneConnected) { | ||||
|             if (! mIsGlance && Settings.getWifiLteExecutionEnabled() && (! phoneConnected || ! connectionAvailable)) { | ||||
|                 // System.println("HomeAssistantApp fetchApiStatus(): In-app Wifi mode (No Phone and Internet connection), early return."); | ||||
|                 return; | ||||
|             } else if (! phoneConnected) { | ||||
|                 // System.println("HomeAssistantApp fetchApiStatus(): No Phone connection, skipping API call."); | ||||
|                 mApiStatus = WatchUi.loadResource($.Rez.Strings.Unavailable) as Lang.String; | ||||
|                 if (mIsGlance) { | ||||
|                     WatchUi.requestUpdate(); | ||||
|                 } else { | ||||
|                     System.println("we here"); | ||||
|                     ErrorView.show(WatchUi.loadResource($.Rez.Strings.NoPhone) as Lang.String); | ||||
|                 } | ||||
|             } else if (! System.getDeviceSettings().connectionAvailable) { | ||||
|             } else if (! connectionAvailable) { | ||||
|                 // System.println("HomeAssistantApp fetchApiStatus(): No Internet connection, skipping API call."); | ||||
|                 mApiStatus = WatchUi.loadResource($.Rez.Strings.Unavailable) as Lang.String; | ||||
|                 if (mIsGlance) { | ||||
|   | ||||
| @@ -27,7 +27,7 @@ class WifiLteExecutionConfirmDelegate extends WatchUi.ConfirmationDelegate { | ||||
|     //!   - url:      (For type `"entity"`) The full Home Assistant entity API URL. | ||||
|     //!   - callback: (For type `"entity"`) A callback method (Method<data as Dictionary>) to handle the response. | ||||
|     //!   - data:     (Optional) A dictionary of data to send with the request. | ||||
|     //!   = exit:     Boolean: true to exit after running command. | ||||
|     //!   - exit:     Boolean: if set to true: exit after running command. | ||||
|     function initialize(cOptions as { | ||||
|         :type     as Lang.String, | ||||
|         :service  as Lang.String or Null, | ||||
|   | ||||
		Reference in New Issue
	
	Block a user