diff --git a/src/panels/my/ha-panel-my.ts b/src/panels/my/ha-panel-my.ts index a083079f41..9810837ccf 100644 --- a/src/panels/my/ha-panel-my.ts +++ b/src/panels/my/ha-panel-my.ts @@ -51,6 +51,9 @@ export const getMyRedirects = (hasSupervisor: boolean): Redirects => ({ component: "calendar", redirect: "/calendar", }, + companion_app: { + redirect: "#external-app-configuration", + }, config: { redirect: "/config/dashboard", }, @@ -323,6 +326,15 @@ class HaPanelMy extends LitElement { return; } + if (this._redirect.redirect === "#external-app-configuration") { + if (this.hass.auth.external?.config.hasSettingsScreen) { + this.hass.auth.external!.fireMessage({ type: "config_screen/show" }); + return; + } + this._error = "not_app"; + return; + } + if ( this._redirect.component && !isComponentLoaded(this.hass, this._redirect.component) @@ -410,6 +422,18 @@ class HaPanelMy extends LitElement { >` ); break; + case "not_app": + error = this.hass.localize( + "ui.panel.my.not_app", + "link", + html`${this.hass.localize("ui.panel.my.download_app")}` + ); + break; default: error = this.hass.localize("ui.panel.my.error") || "Unknown error"; } diff --git a/src/translations/en.json b/src/translations/en.json index a77a941d7e..8834f0583e 100644 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -1473,7 +1473,9 @@ "not_supported": "This redirect is not supported by your Home Assistant instance. Check the {link} for the supported redirects and the version they where introduced.", "component_not_loaded": "This redirect is not supported by your Home Assistant instance. You need the integration {integration} to use this redirect.", "no_supervisor": "This redirect is not supported by your Home Assistant installation. It needs either the Home Assistant Operating System or Home Assistant Supervised installation method. For more information, see the {docs_link}.", + "not_app": "This redirect only works from a mobile device that has the Home Assistant Companion app installed. {link}.", "documentation": "documentation", + "download_app": "Click here to download the app", "faq_link": "My Home Assistant FAQ", "error": "An unknown error occurred" },