mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-27 03:06:41 +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",
|
component: "calendar",
|
||||||
redirect: "/calendar",
|
redirect: "/calendar",
|
||||||
},
|
},
|
||||||
|
companion_app: {
|
||||||
|
redirect: "#external-app-configuration",
|
||||||
|
},
|
||||||
config: {
|
config: {
|
||||||
redirect: "/config/dashboard",
|
redirect: "/config/dashboard",
|
||||||
},
|
},
|
||||||
@ -323,6 +326,15 @@ class HaPanelMy extends LitElement {
|
|||||||
return;
|
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 (
|
if (
|
||||||
this._redirect.component &&
|
this._redirect.component &&
|
||||||
!isComponentLoaded(this.hass, this._redirect.component)
|
!isComponentLoaded(this.hass, this._redirect.component)
|
||||||
@ -410,6 +422,18 @@ class HaPanelMy extends LitElement {
|
|||||||
>`
|
>`
|
||||||
);
|
);
|
||||||
break;
|
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:
|
default:
|
||||||
error = this.hass.localize("ui.panel.my.error") || "Unknown error";
|
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.",
|
"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.",
|
"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}.",
|
"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",
|
"documentation": "documentation",
|
||||||
|
"download_app": "Click here to download the app",
|
||||||
"faq_link": "My Home Assistant FAQ",
|
"faq_link": "My Home Assistant FAQ",
|
||||||
"error": "An unknown error occurred"
|
"error": "An unknown error occurred"
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user