From f495a6affcd34abc2362f8e90485b0057628eb1a Mon Sep 17 00:00:00 2001 From: Yegor Vialov Date: Wed, 12 Feb 2020 13:22:26 +0000 Subject: [PATCH] Move to ha-client.app --- lib/home_assistant.class.dart | 2 +- lib/main.dart | 2 +- lib/managers/auth_manager.class.dart | 4 ++-- lib/managers/connection_manager.class.dart | 4 ++-- lib/pages/integration_settings.page.dart | 2 +- lib/pages/main/main.page.dart | 10 +++++----- lib/pages/whats_new.page.dart | 2 +- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/lib/home_assistant.class.dart b/lib/home_assistant.class.dart index 9812cee..63caddd 100644 --- a/lib/home_assistant.class.dart +++ b/lib/home_assistant.class.dart @@ -69,7 +69,7 @@ class HomeAssistant { _fetchCompleter.complete(); MobileAppIntegrationManager.checkAppRegistration(); } 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) { _fetchCompleter.completeError(e); diff --git a/lib/main.dart b/lib/main.dart index 36922e8..ee726e1 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -244,7 +244,7 @@ class _HAClientAppState extends State { appBar: new AppBar( leading: IconButton( 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"), actions: [ diff --git a/lib/managers/auth_manager.class.dart b/lib/managers/auth_manager.class.dart index fd80160..078e9b8 100644 --- a/lib/managers/auth_manager.class.dart +++ b/lib/managers/auth_manager.class.dart @@ -14,7 +14,7 @@ class AuthManager { Completer completer = Completer(); final flutterWebviewPlugin = new FlutterWebviewPlugin(); 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"); String authCode = url.split("=")[1]; Logger.d("authCode=$authCode"); @@ -23,7 +23,7 @@ class AuthManager { endPoint: "/auth/token", contentType: "application/x-www-form-urlencoded", 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) { Logger.d("Got temp token"); String tempToken = json.decode(response)['access_token']; diff --git a/lib/managers/connection_manager.class.dart b/lib/managers/connection_manager.class.dart index 1474d60..c123b4e 100644 --- a/lib/managers/connection_manager.class.dart +++ b/lib/managers/connection_manager.class.dart @@ -61,9 +61,9 @@ class ConnectionManager { _token = await storage.read(key: "hacl_llt"); Logger.e("Long-lived token read successful"); oauthUrl = "$httpWebHost/auth/authorize?client_id=${Uri.encodeComponent( - 'https://ha-client.estevez.dev')}&redirect_uri=${Uri + 'https://ha-client.app')}&redirect_uri=${Uri .encodeComponent( - 'https://ha-client.estevez.dev/service/auth_callback.html')}"; + 'https://ha-client.app/service/auth_callback.html')}"; settingsLoaded = true; } catch (e) { completer.completeError(HAError("Error reading login details", actions: [HAErrorAction.tryAgain(type: HAErrorActionType.FULL_RELOAD), HAErrorAction.loginAgain()])); diff --git a/lib/pages/integration_settings.page.dart b/lib/pages/integration_settings.page.dart index 42f95fb..b6326b3 100644 --- a/lib/pages/integration_settings.page.dart +++ b/lib/pages/integration_settings.page.dart @@ -118,7 +118,7 @@ class _IntegrationSettingsPageState extends State { Text("Location tracking", style: TextStyle(fontSize: Sizes.largeFontSize-2)), Container(height: Sizes.rowPadding,), 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( "Please read documentation!", style: TextStyle( diff --git a/lib/pages/main/main.page.dart b/lib/pages/main/main.page.dart index b13103d..77e5cb5 100644 --- a/lib/pages/main/main.page.dart +++ b/lib/pages/main/main.page.dart @@ -438,7 +438,7 @@ class _MainPageState extends State with WidgetsBindingObserver, Ticker title: Text("Help"), onTap: () { Navigator.of(context).pop(); - Launcher.launchURL("http://ha-client.estevez.dev/docs"); + Launcher.launchURL("http://ha-client.app/docs"); }, ), new ListTile( @@ -454,10 +454,10 @@ class _MainPageState extends State with WidgetsBindingObserver, Ticker GestureDetector( onTap: () { Navigator.of(context).pop(); - Launcher.launchURL("http://ha-client.estevez.dev/"); + Launcher.launchURL("http://ha-client.app/"); }, child: Text( - "ha-client.estevez.dev", + "ha-client.app", style: TextStyle( color: Colors.blue, decoration: TextDecoration.underline @@ -470,7 +470,7 @@ class _MainPageState extends State with WidgetsBindingObserver, Ticker GestureDetector( onTap: () { 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( "Terms and Conditions", @@ -486,7 +486,7 @@ class _MainPageState extends State with WidgetsBindingObserver, Ticker GestureDetector( onTap: () { 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( "Privacy Policy", diff --git a/lib/pages/whats_new.page.dart b/lib/pages/whats_new.page.dart index 964cd11..b096fc4 100644 --- a/lib/pages/whats_new.page.dart +++ b/lib/pages/whats_new.page.dart @@ -24,7 +24,7 @@ class _WhatsNewPageState extends State { error = ""; }); 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) { setState(() { data = response.body;