Skip to content

Commit

Permalink
Merge branch 'home-assistant:dev' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
iemafzalhassan authored Oct 29, 2024
2 parents 9f019b1 + 6785212 commit 81694ab
Show file tree
Hide file tree
Showing 78 changed files with 2,067 additions and 1,063 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/cast_deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ jobs:
url: ${{ steps.deploy.outputs.NETLIFY_LIVE_URL || steps.deploy.outputs.NETLIFY_URL }}
steps:
- name: Check out files from GitHub
uses: actions/[email protected].1
uses: actions/[email protected].2
with:
ref: dev

- name: Setup Node
uses: actions/setup-node@v4.0.4
uses: actions/setup-node@v4.1.0
with:
node-version-file: ".nvmrc"
cache: yarn
Expand Down Expand Up @@ -57,12 +57,12 @@ jobs:
url: ${{ steps.deploy.outputs.NETLIFY_LIVE_URL || steps.deploy.outputs.NETLIFY_URL }}
steps:
- name: Check out files from GitHub
uses: actions/[email protected].1
uses: actions/[email protected].2
with:
ref: master

- name: Setup Node
uses: actions/setup-node@v4.0.4
uses: actions/setup-node@v4.1.0
with:
node-version-file: ".nvmrc"
cache: yarn
Expand Down
18 changes: 9 additions & 9 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out files from GitHub
uses: actions/[email protected].1
uses: actions/[email protected].2
- name: Setup Node
uses: actions/setup-node@v4.0.4
uses: actions/setup-node@v4.1.0
with:
node-version-file: ".nvmrc"
cache: yarn
Expand All @@ -37,7 +37,7 @@ jobs:
- name: Build resources
run: ./node_modules/.bin/gulp gen-icons-json build-translations build-locale-data gather-gallery-pages
- name: Setup lint cache
uses: actions/[email protected].1
uses: actions/[email protected].2
with:
path: |
node_modules/.cache/prettier
Expand All @@ -58,9 +58,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out files from GitHub
uses: actions/[email protected].1
uses: actions/[email protected].2
- name: Setup Node
uses: actions/setup-node@v4.0.4
uses: actions/setup-node@v4.1.0
with:
node-version-file: ".nvmrc"
cache: yarn
Expand All @@ -76,9 +76,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out files from GitHub
uses: actions/[email protected].1
uses: actions/[email protected].2
- name: Setup Node
uses: actions/setup-node@v4.0.4
uses: actions/setup-node@v4.1.0
with:
node-version-file: ".nvmrc"
cache: yarn
Expand All @@ -100,9 +100,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out files from GitHub
uses: actions/[email protected].1
uses: actions/[email protected].2
- name: Setup Node
uses: actions/setup-node@v4.0.4
uses: actions/setup-node@v4.1.0
with:
node-version-file: ".nvmrc"
cache: yarn
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/[email protected].1
uses: actions/[email protected].2
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/demo_deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ jobs:
url: ${{ steps.deploy.outputs.NETLIFY_LIVE_URL || steps.deploy.outputs.NETLIFY_URL }}
steps:
- name: Check out files from GitHub
uses: actions/[email protected].1
uses: actions/[email protected].2
with:
ref: dev

- name: Setup Node
uses: actions/setup-node@v4.0.4
uses: actions/setup-node@v4.1.0
with:
node-version-file: ".nvmrc"
cache: yarn
Expand Down Expand Up @@ -58,12 +58,12 @@ jobs:
url: ${{ steps.deploy.outputs.NETLIFY_LIVE_URL || steps.deploy.outputs.NETLIFY_URL }}
steps:
- name: Check out files from GitHub
uses: actions/[email protected].1
uses: actions/[email protected].2
with:
ref: master

- name: Setup Node
uses: actions/setup-node@v4.0.4
uses: actions/setup-node@v4.1.0
with:
node-version-file: ".nvmrc"
cache: yarn
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/design_deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ jobs:
url: ${{ steps.deploy.outputs.NETLIFY_LIVE_URL || steps.deploy.outputs.NETLIFY_URL }}
steps:
- name: Check out files from GitHub
uses: actions/[email protected].1
uses: actions/[email protected].2

- name: Setup Node
uses: actions/setup-node@v4.0.4
uses: actions/setup-node@v4.1.0
with:
node-version-file: ".nvmrc"
cache: yarn
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/design_preview.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ jobs:
if: github.repository == 'home-assistant/frontend' && contains(github.event.pull_request.labels.*.name, 'needs design preview')
steps:
- name: Check out files from GitHub
uses: actions/[email protected].1
uses: actions/[email protected].2

- name: Setup Node
uses: actions/setup-node@v4.0.4
uses: actions/setup-node@v4.1.0
with:
node-version-file: ".nvmrc"
cache: yarn
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/nightly.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ jobs:
contents: write
steps:
- name: Checkout the repository
uses: actions/[email protected].1
uses: actions/[email protected].2

- name: Set up Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}

- name: Setup Node
uses: actions/setup-node@v4.0.4
uses: actions/setup-node@v4.1.0
with:
node-version-file: ".nvmrc"
cache: yarn
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
contents: write # Required to upload release assets
steps:
- name: Checkout the repository
uses: actions/[email protected].1
uses: actions/[email protected].2

- name: Verify version
uses: home-assistant/actions/helpers/verify-version@master
Expand All @@ -34,7 +34,7 @@ jobs:
python-version: ${{ env.PYTHON_VERSION }}

- name: Setup Node
uses: actions/setup-node@v4.0.4
uses: actions/setup-node@v4.1.0
with:
node-version-file: ".nvmrc"
cache: yarn
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/translations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/[email protected].1
uses: actions/[email protected].2

- name: Upload Translations
run: |
Expand Down
5 changes: 4 additions & 1 deletion build-scripts/gulp/locale-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,11 @@ const convertToJSON = async (
) => {
let localeData;
try {
// use "pt" for "pt-BR", because "pt-BR" is unsupported by @formatjs
const language = lang === "pt-BR" ? "pt" : lang;

localeData = await readFile(
join(formatjsDir, pkg, subDir, `${lang}.js`),
join(formatjsDir, pkg, subDir, `${language}.js`),
"utf-8"
);
} catch (e) {
Expand Down
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
57 changes: 21 additions & 36 deletions cast/src/receiver/layout/hc-lovelace.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit";
import { customElement, property, query } from "lit/decorators";
import { customElement, property } from "lit/decorators";
import { fireEvent } from "../../../../src/common/dom/fire_event";
import { LovelaceConfig } from "../../../../src/data/lovelace/config/types";
import { getPanelTitleFromUrlPath } from "../../../../src/data/panel";
import { Lovelace } from "../../../../src/panels/lovelace/types";
import "../../../../src/panels/lovelace/views/hui-view";
import "../../../../src/panels/lovelace/views/hui-view-container";
import { HomeAssistant } from "../../../../src/types";
import "./hc-launch-screen";

Expand All @@ -22,8 +23,6 @@ class HcLovelace extends LitElement {

@property() public urlPath: string | null = null;

@query("hui-view") private _huiView?: HTMLElement;

protected render(): TemplateResult {
const index = this._viewIndex;
if (index === undefined) {
Expand All @@ -47,12 +46,22 @@ class HcLovelace extends LitElement {
setEditMode: () => undefined,
showToast: () => undefined,
};

const viewConfig = this.lovelaceConfig.views[index];
const background = viewConfig.background || this.lovelaceConfig.background;

return html`
<hui-view
<hui-view-container
.hass=${this.hass}
.lovelace=${lovelace}
.index=${index}
></hui-view>
.background=${background}
.theme=${viewConfig.theme}
>
<hui-view
.hass=${this.hass}
.lovelace=${lovelace}
.index=${index}
></hui-view>
</hui-view-container>
`;
}

Expand Down Expand Up @@ -82,26 +91,6 @@ class HcLovelace extends LitElement {
}${viewTitle || ""}`
: undefined,
});

const configBackground =
this.lovelaceConfig.views[index].background ||
this.lovelaceConfig.background;

const backgroundStyle =
typeof configBackground === "string"
? configBackground
: configBackground?.image
? `center / cover no-repeat url('${configBackground.image}')`
: undefined;

if (backgroundStyle) {
this._huiView!.style.setProperty(
"--lovelace-background",
backgroundStyle
);
} else {
this._huiView!.style.removeProperty("--lovelace-background");
}
}
}
}
Expand All @@ -125,19 +114,15 @@ class HcLovelace extends LitElement {

static get styles(): CSSResultGroup {
return css`
:host {
min-height: 100vh;
height: 0;
hui-view-container {
display: flex;
flex-direction: column;
position: relative;
min-height: 100vh;
box-sizing: border-box;
background: var(--primary-background-color);
}
:host > * {
flex: 1;
}
hui-view {
background: var(--lovelace-background, var(--primary-background-color));
flex: 1 1 100%;
max-width: 100%;
}
`;
}
Expand Down
Loading

0 comments on commit 81694ab

Please sign in to comment.