Move to ha-client.app
This commit is contained in:
		| @@ -69,7 +69,7 @@ class HomeAssistant { | |||||||
|         _fetchCompleter.complete(); |         _fetchCompleter.complete(); | ||||||
|         MobileAppIntegrationManager.checkAppRegistration(); |         MobileAppIntegrationManager.checkAppRegistration(); | ||||||
|       } else { |       } else { | ||||||
|         _fetchCompleter.completeError(HAError("Mobile app component not found", actions: [HAErrorAction.tryAgain(), HAErrorAction(type: HAErrorActionType.URL ,title: "Help",url: "http://ha-client.estevez.dev/docs#mobile-app-integration")])); |         _fetchCompleter.completeError(HAError("Mobile app component not found", actions: [HAErrorAction.tryAgain(), HAErrorAction(type: HAErrorActionType.URL ,title: "Help",url: "http://ha-client.app/docs#mobile-app-integration")])); | ||||||
|       } |       } | ||||||
|     }).catchError((e) { |     }).catchError((e) { | ||||||
|       _fetchCompleter.completeError(e); |       _fetchCompleter.completeError(e); | ||||||
|   | |||||||
| @@ -244,7 +244,7 @@ class _HAClientAppState extends State<HAClientApp> { | |||||||
|           appBar: new AppBar( |           appBar: new AppBar( | ||||||
|             leading: IconButton( |             leading: IconButton( | ||||||
|                 icon: Icon(Icons.help), |                 icon: Icon(Icons.help), | ||||||
|                 onPressed: () => Launcher.launchURLInCustomTab(context: context, url: "http://ha-client.estevez.dev/docs#authentication") |                 onPressed: () => Launcher.launchURLInCustomTab(context: context, url: "http://ha-client.app/docs#authentication") | ||||||
|             ), |             ), | ||||||
|             title: new Text("Login with HA"), |             title: new Text("Login with HA"), | ||||||
|             actions: <Widget>[ |             actions: <Widget>[ | ||||||
|   | |||||||
| @@ -14,7 +14,7 @@ class AuthManager { | |||||||
|     Completer completer = Completer(); |     Completer completer = Completer(); | ||||||
|     final flutterWebviewPlugin = new FlutterWebviewPlugin(); |     final flutterWebviewPlugin = new FlutterWebviewPlugin(); | ||||||
|     flutterWebviewPlugin.onUrlChanged.listen((String url) { |     flutterWebviewPlugin.onUrlChanged.listen((String url) { | ||||||
|       if (url.startsWith("https://ha-client.estevez.dev/service/auth_callback.html")) { |       if (url.startsWith("https://ha-client.app/service/auth_callback.html")) { | ||||||
|         Logger.d("url=$url"); |         Logger.d("url=$url"); | ||||||
|         String authCode = url.split("=")[1]; |         String authCode = url.split("=")[1]; | ||||||
|         Logger.d("authCode=$authCode"); |         Logger.d("authCode=$authCode"); | ||||||
| @@ -23,7 +23,7 @@ class AuthManager { | |||||||
|           endPoint: "/auth/token", |           endPoint: "/auth/token", | ||||||
|           contentType: "application/x-www-form-urlencoded", |           contentType: "application/x-www-form-urlencoded", | ||||||
|           includeAuthHeader: false, |           includeAuthHeader: false, | ||||||
|           data: "grant_type=authorization_code&code=$authCode&client_id=${Uri.encodeComponent('https://ha-client.estevez.dev')}" |           data: "grant_type=authorization_code&code=$authCode&client_id=${Uri.encodeComponent('https://ha-client.app')}" | ||||||
|         ).then((response) { |         ).then((response) { | ||||||
|           Logger.d("Got temp token"); |           Logger.d("Got temp token"); | ||||||
|           String tempToken = json.decode(response)['access_token']; |           String tempToken = json.decode(response)['access_token']; | ||||||
|   | |||||||
| @@ -61,9 +61,9 @@ class ConnectionManager { | |||||||
|           _token = await storage.read(key: "hacl_llt"); |           _token = await storage.read(key: "hacl_llt"); | ||||||
|           Logger.e("Long-lived token read successful"); |           Logger.e("Long-lived token read successful"); | ||||||
|           oauthUrl = "$httpWebHost/auth/authorize?client_id=${Uri.encodeComponent( |           oauthUrl = "$httpWebHost/auth/authorize?client_id=${Uri.encodeComponent( | ||||||
|               'https://ha-client.estevez.dev')}&redirect_uri=${Uri |               'https://ha-client.app')}&redirect_uri=${Uri | ||||||
|               .encodeComponent( |               .encodeComponent( | ||||||
|               'https://ha-client.estevez.dev/service/auth_callback.html')}"; |               'https://ha-client.app/service/auth_callback.html')}"; | ||||||
|           settingsLoaded = true; |           settingsLoaded = true; | ||||||
|         } catch (e) { |         } catch (e) { | ||||||
|           completer.completeError(HAError("Error reading login details", actions: [HAErrorAction.tryAgain(type: HAErrorActionType.FULL_RELOAD), HAErrorAction.loginAgain()])); |           completer.completeError(HAError("Error reading login details", actions: [HAErrorAction.tryAgain(type: HAErrorActionType.FULL_RELOAD), HAErrorAction.loginAgain()])); | ||||||
|   | |||||||
| @@ -118,7 +118,7 @@ class _IntegrationSettingsPageState extends State<IntegrationSettingsPage> { | |||||||
|                 Text("Location tracking", style: TextStyle(fontSize: Sizes.largeFontSize-2)), |                 Text("Location tracking", style: TextStyle(fontSize: Sizes.largeFontSize-2)), | ||||||
|                 Container(height: Sizes.rowPadding,), |                 Container(height: Sizes.rowPadding,), | ||||||
|                 InkWell( |                 InkWell( | ||||||
|                   onTap: () => Launcher.launchURLInCustomTab(context: context, url: "http://ha-client.estevez.dev/docs#location-tracking"), |                   onTap: () => Launcher.launchURLInCustomTab(context: context, url: "http://ha-client.app/docs#location-tracking"), | ||||||
|                   child: Text( |                   child: Text( | ||||||
|                     "Please read documentation!", |                     "Please read documentation!", | ||||||
|                     style: TextStyle( |                     style: TextStyle( | ||||||
|   | |||||||
| @@ -438,7 +438,7 @@ class _MainPageState extends State<MainPage> with WidgetsBindingObserver, Ticker | |||||||
|         title: Text("Help"), |         title: Text("Help"), | ||||||
|         onTap: () { |         onTap: () { | ||||||
|           Navigator.of(context).pop(); |           Navigator.of(context).pop(); | ||||||
|           Launcher.launchURL("http://ha-client.estevez.dev/docs"); |           Launcher.launchURL("http://ha-client.app/docs"); | ||||||
|         }, |         }, | ||||||
|       ), |       ), | ||||||
|       new ListTile( |       new ListTile( | ||||||
| @@ -454,10 +454,10 @@ class _MainPageState extends State<MainPage> with WidgetsBindingObserver, Ticker | |||||||
|             GestureDetector( |             GestureDetector( | ||||||
|               onTap: () { |               onTap: () { | ||||||
|                 Navigator.of(context).pop(); |                 Navigator.of(context).pop(); | ||||||
|                 Launcher.launchURL("http://ha-client.estevez.dev/"); |                 Launcher.launchURL("http://ha-client.app/"); | ||||||
|               }, |               }, | ||||||
|               child: Text( |               child: Text( | ||||||
|                 "ha-client.estevez.dev", |                 "ha-client.app", | ||||||
|                 style: TextStyle( |                 style: TextStyle( | ||||||
|                     color: Colors.blue, |                     color: Colors.blue, | ||||||
|                     decoration: TextDecoration.underline |                     decoration: TextDecoration.underline | ||||||
| @@ -470,7 +470,7 @@ class _MainPageState extends State<MainPage> with WidgetsBindingObserver, Ticker | |||||||
|             GestureDetector( |             GestureDetector( | ||||||
|               onTap: () { |               onTap: () { | ||||||
|                 Navigator.of(context).pop(); |                 Navigator.of(context).pop(); | ||||||
|                 Launcher.launchURLInCustomTab(context: context, url: "http://ha-client.estevez.dev/terms_and_conditions"); |                 Launcher.launchURLInCustomTab(context: context, url: "http://ha-client.app/terms_and_conditions"); | ||||||
|               }, |               }, | ||||||
|               child: Text( |               child: Text( | ||||||
|                 "Terms and Conditions", |                 "Terms and Conditions", | ||||||
| @@ -486,7 +486,7 @@ class _MainPageState extends State<MainPage> with WidgetsBindingObserver, Ticker | |||||||
|             GestureDetector( |             GestureDetector( | ||||||
|               onTap: () { |               onTap: () { | ||||||
|                 Navigator.of(context).pop(); |                 Navigator.of(context).pop(); | ||||||
|                 Launcher.launchURLInCustomTab(context: context, url: "http://ha-client.estevez.dev/privacy_policy"); |                 Launcher.launchURLInCustomTab(context: context, url: "http://ha-client.app/privacy_policy"); | ||||||
|               }, |               }, | ||||||
|               child: Text( |               child: Text( | ||||||
|                 "Privacy Policy", |                 "Privacy Policy", | ||||||
|   | |||||||
| @@ -24,7 +24,7 @@ class _WhatsNewPageState extends State<WhatsNewPage> { | |||||||
|       error = ""; |       error = ""; | ||||||
|     }); |     }); | ||||||
|     http.Response response; |     http.Response response; | ||||||
|     response = await http.get("http://ha-client.estevez.dev/service/whats_new_0.7.0.md"); |     response = await http.get("http://ha-client.app/service/whats_new_0.7.0.md"); | ||||||
|     if (response.statusCode == 200) { |     if (response.statusCode == 200) { | ||||||
|       setState(() { |       setState(() { | ||||||
|         data = response.body; |         data = response.body; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user