Skip to content

Commit

Permalink
Fix cast
Browse files Browse the repository at this point in the history
  • Loading branch information
piitaya committed Oct 28, 2024
1 parent ebe0d0e commit 47572e8
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 13 deletions.
12 changes: 7 additions & 5 deletions cast/src/launcher/layout/hc-cast.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import "@material/mwc-button/mwc-button";
import { ActionDetail } from "@material/mwc-list/mwc-list";
import "@material/mwc-list/mwc-list";
import type { ActionDetail } from "@material/mwc-list/mwc-list";
import { mdiCast, mdiCastConnected, mdiViewDashboard } from "@mdi/js";
import { Auth, Connection } from "home-assistant-js-websocket";
import { CSSResultGroup, LitElement, TemplateResult, css, html } from "lit";
Expand Down Expand Up @@ -89,8 +90,8 @@ class HcCast extends LitElement {
generateDefaultViewConfig({}, {}, {}, {}, () => ""),
]
).map(
(view, idx) =>
html`<ha-list-item
(view, idx) => html`
<ha-list-item
graphic="avatar"
.activated=${this.castManager.status?.lovelacePath ===
(view.path ?? idx)}
Expand All @@ -108,8 +109,9 @@ class HcCast extends LitElement {
: html`<ha-svg-icon
slot="item-icon"
.path=${mdiViewDashboard}
></ha-svg-icon>`}</ha-list-item
> `
></ha-svg-icon>`}
</ha-list-item>
`
)}</mwc-list
>
`}
Expand Down
9 changes: 4 additions & 5 deletions cast/src/receiver/layout/hc-lovelace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class HcLovelace extends LitElement {
<hui-view-container
.hass=${this.hass}
.background=${background}
.theme=${this.lovelaceConfig}
.theme=${viewConfig.theme}
>
<hui-view
.hass=${this.hass}
Expand Down Expand Up @@ -115,15 +115,14 @@ class HcLovelace extends LitElement {
static get styles(): CSSResultGroup {
return css`
hui-view-container {
display: flex;
position: relative;
min-height: 100vh;
height: 0;
display: flex;
flex-direction: column;
box-sizing: border-box;
}
hui-view {
flex: 1;
flex: 1 1 100%;
max-width: 100%;
}
`;
}
Expand Down
2 changes: 1 addition & 1 deletion src/panels/energy/ha-panel-energy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -397,9 +397,9 @@ class PanelEnergy extends LitElement {
hui-view-container {
position: relative;
display: flex;
padding-top: calc(var(--header-height) + env(safe-area-inset-top));
min-height: 100vh;
box-sizing: border-box;
padding-top: calc(var(--header-height) + env(safe-area-inset-top));
padding-left: env(safe-area-inset-left);
padding-right: env(safe-area-inset-right);
padding-inline-start: env(safe-area-inset-left);
Expand Down
2 changes: 1 addition & 1 deletion src/panels/lovelace/hui-root.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1061,9 +1061,9 @@ class HUIRoot extends LitElement {
hui-view-container {
position: relative;
display: flex;
padding-top: calc(var(--header-height) + env(safe-area-inset-top));
min-height: 100vh;
box-sizing: border-box;
padding-top: calc(var(--header-height) + env(safe-area-inset-top));
padding-left: env(safe-area-inset-left);
padding-right: env(safe-area-inset-right);
padding-inline-start: env(safe-area-inset-left);
Expand Down
2 changes: 1 addition & 1 deletion src/panels/lovelace/views/hui-view-container.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class HuiViewContainer extends LitElement {
}

private _computeBackgroundProperty(background?: BackgroundConfig) {
if (typeof background === "object") {
if (typeof background === "object" && background.image) {
return `center / cover no-repeat url('${background.image}')`;
}
if (typeof background === "string") {
Expand Down

0 comments on commit 47572e8

Please sign in to comment.