Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
bramkragten committed Aug 5, 2024
2 parents b368f88 + 51b6d77 commit b5c2b55
Show file tree
Hide file tree
Showing 11 changed files with 198 additions and 150 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ jobs:
env:
IS_TEST: "true"
- name: Upload bundle stats
uses: actions/[email protected].4
uses: actions/[email protected].5
with:
name: frontend-bundle-stats
path: build/stats/*.json
Expand All @@ -113,7 +113,7 @@ jobs:
env:
IS_TEST: "true"
- name: Upload bundle stats
uses: actions/[email protected].4
uses: actions/[email protected].5
with:
name: supervisor-bundle-stats
path: build/stats/*.json
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/nightly.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,14 @@ jobs:
run: tar -czvf translations.tar.gz translations

- name: Upload build artifacts
uses: actions/[email protected].4
uses: actions/[email protected].5
with:
name: wheels
path: dist/home_assistant_frontend*.whl
if-no-files-found: error

- name: Upload translations
uses: actions/[email protected].4
uses: actions/[email protected].5
with:
name: translations
path: translations.tar.gz
Expand Down
2 changes: 1 addition & 1 deletion build-scripts/gulp/compress.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const compressDistZopfli = (rootDir, modernDir) =>
[
`${rootDir}/**/${filesGlob}`,
`!${modernDir}/**/${filesGlob}`,
`!${rootDir}/sw-modern.js`,
`!${rootDir}/{sw-modern,service_worker}.js`,
`${rootDir}/{authorize,onboarding}.html`,
],
{ base: rootDir }
Expand Down
12 changes: 9 additions & 3 deletions build-scripts/gulp/service-worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import { deleteAsync } from "del";
import gulp from "gulp";
import { mkdir, readFile, writeFile } from "node:fs/promises";
import { join, relative } from "node:path";
import { mkdir, readFile, symlink, writeFile } from "node:fs/promises";
import { basename, join, relative } from "node:path";
import { injectManifest } from "workbox-build";
import paths from "../paths.cjs";

Expand Down Expand Up @@ -41,10 +41,11 @@ gulp.task("gen-service-worker-app-prod", () =>
await readFile(join(outPath, "manifest.json"), "utf-8")
);
const swSrc = join(paths.app_output_root, manifest["service-worker.js"]);
const swDest = join(paths.app_output_root, `sw-${build}.js`);
const buildDir = relative(paths.app_output_root, outPath);
const { warnings } = await injectManifest({
swSrc,
swDest: join(paths.app_output_root, `sw-${build}.js`),
swDest,
injectionPoint: "__WB_MANIFEST__",
// Files that mach this pattern will be considered unique and skip revision check
// ignore JS files + translation files
Expand Down Expand Up @@ -76,6 +77,11 @@ gulp.task("gen-service-worker-app-prod", () =>
);
}
await deleteAsync(`${swSrc}?(.map)`);
// Needed to install new SW from a cached HTML
if (build === "modern") {
const swOld = join(paths.app_output_root, "service_worker.js");
await symlink(basename(swDest), swOld);
}
})
)
);
50 changes: 50 additions & 0 deletions gallery/src/pages/lovelace/tile-card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { getEntity } from "../../../../src/fake_data/entity";
import { provideHass } from "../../../../src/fake_data/provide_hass";
import "../../components/demo-cards";
import { mockIcons } from "../../../../demo/src/stubs/icons";
import { ClimateEntityFeature } from "../../../../src/data/climate";

const ENTITIES = [
getEntity("switch", "tv_outlet", "on", {
Expand Down Expand Up @@ -60,6 +61,36 @@ const ENTITIES = [
CoverEntityFeature.OPEN_TILT +
CoverEntityFeature.STOP_TILT,
}),
getEntity("input_number", "counter", "1.0", {
friendly_name: "Counter",
initial: 0,
min: 0,
max: 100,
step: 1,
mode: "slider",
}),
getEntity("climate", "dual_thermostat", "heat/cool", {
friendly_name: "Dual thermostat",
hvac_modes: ["off", "cool", "heat_cool", "auto", "dry", "fan_only"],
min_temp: 7,
max_temp: 35,
fan_modes: ["on_low", "on_high", "auto_low", "auto_high", "off"],
preset_modes: ["home", "eco", "away"],
swing_modes: ["auto", "1", "2", "3", "off"],
current_temperature: 23,
target_temp_high: 24,
target_temp_low: 21,
fan_mode: "auto_low",
preset_mode: "home",
swing_mode: "auto",
supported_features:
ClimateEntityFeature.TURN_ON +
ClimateEntityFeature.TURN_OFF +
ClimateEntityFeature.SWING_MODE +
ClimateEntityFeature.PRESET_MODE +
ClimateEntityFeature.FAN_MODE +
ClimateEntityFeature.TARGET_TEMPERATURE_RANGE,
}),
];

const CONFIGS = [
Expand Down Expand Up @@ -193,6 +224,25 @@ const CONFIGS = [
- type: "cover-tilt"
`,
},
{
heading: "Number buttons feature",
config: `
- type: tile
entity: input_number.counter
features:
- type: numeric-input
style: buttons
`,
},
{
heading: "Dual thermostat feature",
config: `
- type: tile
entity: climate.dual_thermostat
features:
- type: target-temperature
`,
},
];

@customElement("demo-lovelace-tile-card")
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -149,11 +149,11 @@
"xss": "1.0.15"
},
"devDependencies": {
"@babel/core": "7.24.9",
"@babel/core": "7.25.2",
"@babel/helper-define-polyfill-provider": "0.6.2",
"@babel/plugin-proposal-decorators": "7.24.7",
"@babel/plugin-transform-runtime": "7.24.7",
"@babel/preset-env": "7.25.0",
"@babel/preset-env": "7.25.3",
"@babel/preset-typescript": "7.24.7",
"@bundle-stats/plugin-webpack-filter": "4.13.4",
"@koa/cors": "5.0.0",
Expand Down Expand Up @@ -185,8 +185,8 @@
"@types/tar": "6.1.13",
"@types/ua-parser-js": "0.7.39",
"@types/webspeechapi": "0.0.29",
"@typescript-eslint/eslint-plugin": "7.17.0",
"@typescript-eslint/parser": "7.17.0",
"@typescript-eslint/eslint-plugin": "7.18.0",
"@typescript-eslint/parser": "7.18.0",
"@web/dev-server": "0.1.38",
"@web/dev-server-rollup": "0.4.1",
"babel-loader": "9.1.3",
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "home-assistant-frontend"
version = "20240802.0"
version = "20240805.0"
license = {text = "Apache-2.0"}
description = "The Home Assistant frontend"
readme = "README.md"
Expand Down
11 changes: 4 additions & 7 deletions src/panels/config/helpers/dialog-helper-detail.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,10 @@ export class DialogHelperDetail extends LitElement {
this._opened = true;
await this.updateComplete;
this.hass.loadFragmentTranslation("config");
Promise.all([
getConfigFlowHandlers(this.hass, ["helper"]),
// Ensure the titles are loaded before we render the flows.
this.hass.loadBackendTranslation("title", undefined, true),
]).then(([flows]) => {
this._helperFlows = flows;
});
const flows = await getConfigFlowHandlers(this.hass, ["helper"]);
await this.hass.loadBackendTranslation("title", flows, true);
// Ensure the titles are loaded before we render the flows.
this._helperFlows = flows;
}

public closeDialog(): void {
Expand Down
4 changes: 2 additions & 2 deletions src/panels/config/integrations/ha-integration-card.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import "@lrnwebcomponents/simple-tooltip/simple-tooltip";
import { mdiCloud, mdiCodeBraces, mdiPackageVariant } from "@mdi/js";
import { mdiCloud, mdiFileCodeOutline, mdiPackageVariant } from "@mdi/js";
import {
CSSResultGroup,
LitElement,
Expand Down Expand Up @@ -184,7 +184,7 @@ export class HaIntegrationCard extends LitElement {
: nothing}
${this.manifest && !this.manifest?.config_flow
? html`<div class="icon yaml">
<ha-svg-icon .path=${mdiCodeBraces}></ha-svg-icon>
<ha-svg-icon .path=${mdiFileCodeOutline}></ha-svg-icon>
<simple-tooltip
animation-delay="0"
.position=${computeRTL(this.hass) ? "right" : "left"}
Expand Down
7 changes: 0 additions & 7 deletions src/util/register-service-worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,6 @@ export const registerServiceWorker = async (
return;
}

if (reg?.active?.scriptURL.includes("service_worker.js")) {
// We are running an old version of the service worker. Force reload.
await reg.unregister();
// @ts-ignore Firefox supports force reload
location.reload(true);
}

reg.addEventListener("updatefound", () => {
const installingWorker = reg.installing;

Expand Down
Loading

0 comments on commit b5c2b55

Please sign in to comment.