Compare commits

...

2 Commits

Author SHA1 Message Date
Bruno Pantaleão 959c440844 Remove inline comments 2026-07-16 13:43:33 +02:00
Bruno Pantaleão be440b0dd3 Add hasLoader external bus config for companion app loaders
When a companion app reports hasLoader, keep the frontend launch screen
blank so the app can render its own loading screen.
2026-07-16 13:41:59 +02:00
4 changed files with 30 additions and 1 deletions
+1
View File
@@ -366,6 +366,7 @@ export interface ExternalConfig {
appVersion?: string;
hasEntityAddTo?: boolean; // Supports "Add to" from more-info dialog, with action coming from external app
hasAssistSettings?: boolean; // Shows the "This device" section in voice assistant settings
hasLoader?: boolean; // App renders its own loading screen, so the frontend launch screen stays blank
}
export interface ExternalEntityAddToAction {
+3
View File
@@ -59,6 +59,9 @@
#ha-launch-screen.removing {
opacity: 0;
}
#ha-launch-screen.blank > * {
display: none;
}
#ha-launch-screen svg {
width: 112px;
flex-shrink: 0;
+13
View File
@@ -17,6 +17,8 @@ import QuickBarMixin from "../state/quick-bar-mixin";
import type { HomeAssistant, Route } from "../types";
import { storeState } from "../util/ha-pref-storage";
import {
blankLaunchScreen,
clearLaunchScreenInfoBox,
removeLaunchScreen,
renderLaunchScreenInfoBox,
} from "../util/launch-screen";
@@ -59,6 +61,8 @@ export class HomeAssistantAppEl extends QuickBarMixin(HassElement) {
private _httpPendingDialogOpen = false;
private _appHandlesLoader = false;
private _panelUrl: string;
@storage({ key: "ha-version", state: false, subscribe: false })
@@ -306,6 +310,11 @@ export class HomeAssistantAppEl extends QuickBarMixin(HassElement) {
const { auth, conn } = result;
this._checkUpdate(conn);
this.initializeHass(auth, conn);
if (this.hass?.auth.external?.config.hasLoader) {
this._appHandlesLoader = true;
blankLaunchScreen();
this._renderInitInfo(false);
}
} catch (_err: any) {
this._renderInitInfo(true);
}
@@ -365,6 +374,10 @@ export class HomeAssistantAppEl extends QuickBarMixin(HassElement) {
}
private _renderInitInfo(error: boolean) {
if (this._appHandlesLoader) {
clearLaunchScreenInfoBox();
return;
}
renderLaunchScreenInfoBox(
html`<ha-init-page
.error=${error}
+13 -1
View File
@@ -1,5 +1,5 @@
import type { TemplateResult } from "lit";
import { render } from "lit";
import { nothing, render } from "lit";
import { parseAnimationDuration } from "../common/util/parse-animation-duration";
import { withViewTransition } from "../common/util/view-transition";
@@ -27,9 +27,21 @@ export const removeLaunchScreen = () => {
});
};
export const blankLaunchScreen = () => {
const launchScreenElement = document.getElementById("ha-launch-screen");
launchScreenElement?.classList.add("blank");
};
export const renderLaunchScreenInfoBox = (content: TemplateResult) => {
const infoBoxElement = document.getElementById("ha-launch-screen-info-box");
if (infoBoxElement) {
render(content, infoBoxElement);
}
};
export const clearLaunchScreenInfoBox = () => {
const infoBoxElement = document.getElementById("ha-launch-screen-info-box");
if (infoBoxElement) {
render(nothing, infoBoxElement);
}
};