mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-24 09:46:36 +00:00
Add My support for companion app settings (#17398)
This commit is contained in:
parent
2c7e17ce89
commit
4fd5dfd6ae
@ -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`<a
|
||||
target="_blank"
|
||||
rel="noreferrer noopener"
|
||||
href="https://companion.home-assistant.io/download"
|
||||
>${this.hass.localize("ui.panel.my.download_app")}</a
|
||||
>`
|
||||
);
|
||||
break;
|
||||
default:
|
||||
error = this.hass.localize("ui.panel.my.error") || "Unknown error";
|
||||
}
|
||||
|
@ -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"
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user