Compare commits

..

6 Commits

Author SHA1 Message Date
Joakim Plate 34dba7ea5a Normalize number entity row input (#53284)
hui-number-entity-row.ts bound the raw stateObj.state string to the
non-slider ha-input, so a state like "50.0" showed decimals on the
device page. state-card-number.ts (used by the more-info dialog)
already normalizes via Number(state).toString(); apply the same here
so both views render consistently.
2026-07-24 18:25:56 +02:00
renovate[bot] e76e7d1064 Unpin dependency glob resolution (#53282)
* Pin dependency glob to 10.5.0

* Apply suggestions from code review

Co-authored-by: Simon Lamon <32477463+silamon@users.noreply.github.com>

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Simon Lamon <32477463+silamon@users.noreply.github.com>
2026-07-24 15:39:16 +00:00
Paulus Schoutsen b6675159ae Mock the usage prediction command in the demo (#53279)
Mock usage_prediction/common_control and load the usage_prediction
component so common-controls sections in strategy dashboards render
suggested entities in the demo. Entities that don't exist in the
currently loaded demo config are filtered out by the section strategy.


Claude-Session: https://claude.ai/code/session_01KZ6ydA22VeQndgynH4SxCV

Co-authored-by: Claude <noreply@anthropic.com>
2026-07-24 17:20:29 +02:00
renovate[bot] 9d96d0b4aa Update dependency @rspack/core to v2.1.5 (#53276)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-07-24 13:07:05 +00:00
Paulus Schoutsen d900cc70c5 Fix unhandled error when the Cast SDK fails to load (#53271)
* Fix unhandled error when the Cast SDK fails to load

Resolve the Cast API as unavailable when the cast_sender.js script
fails to load (offline, blocked by an ad-blocker or firewall), instead
of leaking an unhandled promise rejection. Handle the resulting
getCastManager rejection in the demo cast row, matching hui-cast-row,
so the row hides itself.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V3oj5uaCRRaoXRd5iEffhi

* Drop redundant comment

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V3oj5uaCRRaoXRd5iEffhi

* Simplify promise memoization with ??=

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V3oj5uaCRRaoXRd5iEffhi

* Revert "Simplify promise memoization with ??="

This reverts commit 5527741b6a.

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-07-24 13:01:46 +00:00
pcan08 837baff26c Fix My Backups navigation (#53259) 2026-07-24 14:57:41 +02:00
9 changed files with 134 additions and 115 deletions
@@ -52,23 +52,6 @@ gulp.task("fetch-nightly-translations", async function () {
currentArtifact = null;
}
try {
await fetchTranslations(currentArtifact);
} catch (err) {
// Local builds should work offline or without valid GitHub credentials,
// so fall back to English only. CI must fail instead of silently
// building without translations.
if (process.env.CI) {
throw err;
}
console.warn(
"Failed to fetch nightly translations, continuing with English only:",
err.message
);
}
});
async function fetchTranslations(currentArtifact) {
// To store file writing promises
const createExtractDir = mkdir(EXTRACT_DIR, { recursive: true });
const writings = [];
@@ -147,6 +130,11 @@ async function fetchTranslations(currentArtifact) {
if (!latestArtifact) {
throw Error("Latest nightly workflow run has no translations artifact");
}
writings.push(
createExtractDir.then(
writeFile(ARTIFACT_FILE, JSON.stringify(latestArtifact, null, 2))
)
);
// Remove the current translations
const deleteCurrent = Promise.all(writings).then(
@@ -172,12 +160,7 @@ async function fetchTranslations(currentArtifact) {
await new Promise((resolve, reject) => {
extractStream.on("close", resolve).on("error", reject);
});
// Record the artifact only after successful extraction, so a failed fetch
// is retried by the next build instead of being considered current.
await createExtractDir;
await writeFile(ARTIFACT_FILE, JSON.stringify(latestArtifact, null, 2));
}
});
gulp.task(
"setup-and-fetch-nightly-translations",
+23 -18
View File
@@ -41,25 +41,30 @@ class CastDemoRow extends LitElement implements LovelaceRow {
protected firstUpdated(changedProps: PropertyValues<this>) {
super.firstUpdated(changedProps);
import("../../../src/cast/cast_manager").then(({ getCastManager }) =>
getCastManager().then((mgr) => {
this._castManager = mgr;
mgr.addEventListener("state-changed", () => {
this.requestUpdate();
});
mgr.castContext.addEventListener(
cast.framework.CastContextEventType.SESSION_STATE_CHANGED,
(ev) => {
// On Android, opening a new session always results in SESSION_RESUMED.
// So treat both as the same.
if (
ev.sessionState === "SESSION_STARTED" ||
ev.sessionState === "SESSION_RESUMED"
) {
castSendShowDemo(mgr);
getCastManager().then(
(mgr) => {
this._castManager = mgr;
mgr.addEventListener("state-changed", () => {
this.requestUpdate();
});
mgr.castContext.addEventListener(
cast.framework.CastContextEventType.SESSION_STATE_CHANGED,
(ev) => {
// On Android, opening a new session always results in SESSION_RESUMED.
// So treat both as the same.
if (
ev.sessionState === "SESSION_STARTED" ||
ev.sessionState === "SESSION_RESUMED"
) {
castSendShowDemo(mgr);
}
}
}
);
})
);
},
() => {
this._castManager = null;
}
)
);
}
+10 -2
View File
@@ -29,6 +29,7 @@ import { mockSystemLog } from "./stubs/system_log";
import { mockTemplate } from "./stubs/template";
import { mockTodo } from "./stubs/todo";
import { mockTranslations } from "./stubs/translations";
import { mockUsagePrediction } from "./stubs/usage_prediction";
import "./cloud/cloud-demo-controls";
// WS command / REST path prefixes whose mocks live in the lazily imported
@@ -74,11 +75,17 @@ export class HaDemo extends HomeAssistantAppEl {
// The cloud account page only fetches backup config and the webhook count
// when those integrations are loaded. Enable them here (demo only) so the
// mocked backup/config/info and webhook/list are queried.
// mocked backup/config/info and webhook/list are queried. usage_prediction
// is needed for common-controls sections in strategy dashboards.
hass.updateHass({
config: {
...hass.config,
components: [...(hass.config?.components ?? []), "backup", "webhook"],
components: [
...(hass.config?.components ?? []),
"backup",
"webhook",
"usage_prediction",
],
},
});
@@ -122,6 +129,7 @@ export class HaDemo extends HomeAssistantAppEl {
mockDeviceRegistry(hass, demoDevices);
mockFloorRegistry(hass);
mockLabelRegistry(hass);
mockUsagePrediction(hass);
mockEntityRegistry(hass, [
{
config_entry_id: "co2signal",
+19
View File
@@ -0,0 +1,19 @@
import type { CommonControlsResult } from "../../../src/data/usage_prediction";
import type { MockHomeAssistant } from "../../../src/fake_data/provide_hass";
export const mockUsagePrediction = (hass: MockHomeAssistant) => {
// Entities that don't exist in the currently loaded demo config are
// filtered out by the common-controls section strategy.
hass.mockWS("usage_prediction/common_control", (): CommonControlsResult => ({
entities: [
"light.living_room_floor_lamp",
"climate.living_room",
"cover.living_room_blinds",
"media_player.living_room_speaker",
"light.kitchen_spotlights",
"switch.coffee_machine",
"light.bedside_lamp",
"alarm_control_panel.home_alarm",
],
}));
};
+2 -3
View File
@@ -152,7 +152,7 @@
"@octokit/rest": "22.0.1",
"@playwright/test": "1.61.1",
"@rsdoctor/rspack-plugin": "1.6.1",
"@rspack/core": "2.1.4",
"@rspack/core": "2.1.5",
"@rspack/dev-server": "2.1.0",
"@types/babel__plugin-transform-runtime": "7.9.5",
"@types/chromecast-caf-receiver": "6.0.26",
@@ -226,8 +226,7 @@
"@fullcalendar/daygrid": "6.1.21",
"globals": "17.7.0",
"tslib": "2.8.1",
"@material/mwc-list@^0.27.0": "patch:@material/mwc-list@npm%3A0.27.0#~/.yarn/patches/@material-mwc-list-npm-0.27.0-5344fc9de4.patch",
"glob@^10.2.2": "^10.5.0"
"@material/mwc-list@^0.27.0": "patch:@material/mwc-list@npm%3A0.27.0#~/.yarn/patches/@material-mwc-list-npm-0.27.0-5344fc9de4.patch"
},
"packageManager": "yarn@4.17.1",
"volta": {
+11 -10
View File
@@ -9,16 +9,17 @@ export const castApiAvailable = () => {
loadedPromise = new Promise((resolve) => {
(window as any).__onGCastApiAvailable = resolve;
});
// Any element with a specific ID will get set as a JS variable on window
// This will override the cast SDK if the iconset is loaded afterwards.
// Conflicting IDs will no longer mess with window, so we'll just append one.
const el = document.createElement("div");
el.id = "cast";
document.body.append(el);
loadJS(
"https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1"
);
// Any element with a specific ID will get set as a JS variable on window
// This will override the cast SDK if the iconset is loaded afterwards.
// Conflicting IDs will no longer mess with window, so we'll just append one.
const el = document.createElement("div");
el.id = "cast";
document.body.append(el);
loadJS(
"https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1"
).catch(() => resolve(false));
});
return loadedPromise;
};
@@ -145,6 +145,10 @@ class HaConfigBackupBackups extends SubscribeMixin(LitElement) {
public connectedCallback() {
super.connectedCallback();
// Re-apply the type filter from the URL when the page is (re)displayed,
// e.g. when navigating back to a cached instance of this page with a
// different `type` query param.
this._setFiltersFromUrl();
window.addEventListener("location-changed", this._locationChanged);
window.addEventListener("popstate", this._popState);
}
@@ -107,7 +107,7 @@ class HuiNumberEntityRow extends LitElement implements LovelaceRow {
.step=${Number(stateObj.attributes.step)}
.min=${Number(stateObj.attributes.min)}
.max=${Number(stateObj.attributes.max)}
.value=${stateObj.state}
.value=${Number(stateObj.state).toString()}
type="number"
@change=${this._selectedValueChanged}
>
+58 -58
View File
@@ -4755,65 +4755,65 @@ __metadata:
languageName: node
linkType: hard
"@rspack/binding-darwin-arm64@npm:2.1.4":
version: 2.1.4
resolution: "@rspack/binding-darwin-arm64@npm:2.1.4"
"@rspack/binding-darwin-arm64@npm:2.1.5":
version: 2.1.5
resolution: "@rspack/binding-darwin-arm64@npm:2.1.5"
conditions: os=darwin & cpu=arm64
languageName: node
linkType: hard
"@rspack/binding-darwin-x64@npm:2.1.4":
version: 2.1.4
resolution: "@rspack/binding-darwin-x64@npm:2.1.4"
"@rspack/binding-darwin-x64@npm:2.1.5":
version: 2.1.5
resolution: "@rspack/binding-darwin-x64@npm:2.1.5"
conditions: os=darwin & cpu=x64
languageName: node
linkType: hard
"@rspack/binding-linux-arm64-gnu@npm:2.1.4":
version: 2.1.4
resolution: "@rspack/binding-linux-arm64-gnu@npm:2.1.4"
"@rspack/binding-linux-arm64-gnu@npm:2.1.5":
version: 2.1.5
resolution: "@rspack/binding-linux-arm64-gnu@npm:2.1.5"
conditions: os=linux & cpu=arm64 & libc=glibc
languageName: node
linkType: hard
"@rspack/binding-linux-arm64-musl@npm:2.1.4":
version: 2.1.4
resolution: "@rspack/binding-linux-arm64-musl@npm:2.1.4"
"@rspack/binding-linux-arm64-musl@npm:2.1.5":
version: 2.1.5
resolution: "@rspack/binding-linux-arm64-musl@npm:2.1.5"
conditions: os=linux & cpu=arm64 & libc=musl
languageName: node
linkType: hard
"@rspack/binding-linux-riscv64-gnu@npm:2.1.4":
version: 2.1.4
resolution: "@rspack/binding-linux-riscv64-gnu@npm:2.1.4"
"@rspack/binding-linux-riscv64-gnu@npm:2.1.5":
version: 2.1.5
resolution: "@rspack/binding-linux-riscv64-gnu@npm:2.1.5"
conditions: os=linux & cpu=riscv64 & libc=glibc
languageName: node
linkType: hard
"@rspack/binding-linux-riscv64-musl@npm:2.1.4":
version: 2.1.4
resolution: "@rspack/binding-linux-riscv64-musl@npm:2.1.4"
"@rspack/binding-linux-riscv64-musl@npm:2.1.5":
version: 2.1.5
resolution: "@rspack/binding-linux-riscv64-musl@npm:2.1.5"
conditions: os=linux & cpu=riscv64 & libc=musl
languageName: node
linkType: hard
"@rspack/binding-linux-x64-gnu@npm:2.1.4":
version: 2.1.4
resolution: "@rspack/binding-linux-x64-gnu@npm:2.1.4"
"@rspack/binding-linux-x64-gnu@npm:2.1.5":
version: 2.1.5
resolution: "@rspack/binding-linux-x64-gnu@npm:2.1.5"
conditions: os=linux & cpu=x64 & libc=glibc
languageName: node
linkType: hard
"@rspack/binding-linux-x64-musl@npm:2.1.4":
version: 2.1.4
resolution: "@rspack/binding-linux-x64-musl@npm:2.1.4"
"@rspack/binding-linux-x64-musl@npm:2.1.5":
version: 2.1.5
resolution: "@rspack/binding-linux-x64-musl@npm:2.1.5"
conditions: os=linux & cpu=x64 & libc=musl
languageName: node
linkType: hard
"@rspack/binding-wasm32-wasi@npm:2.1.4":
version: 2.1.4
resolution: "@rspack/binding-wasm32-wasi@npm:2.1.4"
"@rspack/binding-wasm32-wasi@npm:2.1.5":
version: 2.1.5
resolution: "@rspack/binding-wasm32-wasi@npm:2.1.5"
dependencies:
"@emnapi/core": "npm:1.11.2"
"@emnapi/runtime": "npm:1.11.2"
@@ -4822,43 +4822,43 @@ __metadata:
languageName: node
linkType: hard
"@rspack/binding-win32-arm64-msvc@npm:2.1.4":
version: 2.1.4
resolution: "@rspack/binding-win32-arm64-msvc@npm:2.1.4"
"@rspack/binding-win32-arm64-msvc@npm:2.1.5":
version: 2.1.5
resolution: "@rspack/binding-win32-arm64-msvc@npm:2.1.5"
conditions: os=win32 & cpu=arm64
languageName: node
linkType: hard
"@rspack/binding-win32-ia32-msvc@npm:2.1.4":
version: 2.1.4
resolution: "@rspack/binding-win32-ia32-msvc@npm:2.1.4"
"@rspack/binding-win32-ia32-msvc@npm:2.1.5":
version: 2.1.5
resolution: "@rspack/binding-win32-ia32-msvc@npm:2.1.5"
conditions: os=win32 & cpu=ia32
languageName: node
linkType: hard
"@rspack/binding-win32-x64-msvc@npm:2.1.4":
version: 2.1.4
resolution: "@rspack/binding-win32-x64-msvc@npm:2.1.4"
"@rspack/binding-win32-x64-msvc@npm:2.1.5":
version: 2.1.5
resolution: "@rspack/binding-win32-x64-msvc@npm:2.1.5"
conditions: os=win32 & cpu=x64
languageName: node
linkType: hard
"@rspack/binding@npm:2.1.4":
version: 2.1.4
resolution: "@rspack/binding@npm:2.1.4"
"@rspack/binding@npm:2.1.5":
version: 2.1.5
resolution: "@rspack/binding@npm:2.1.5"
dependencies:
"@rspack/binding-darwin-arm64": "npm:2.1.4"
"@rspack/binding-darwin-x64": "npm:2.1.4"
"@rspack/binding-linux-arm64-gnu": "npm:2.1.4"
"@rspack/binding-linux-arm64-musl": "npm:2.1.4"
"@rspack/binding-linux-riscv64-gnu": "npm:2.1.4"
"@rspack/binding-linux-riscv64-musl": "npm:2.1.4"
"@rspack/binding-linux-x64-gnu": "npm:2.1.4"
"@rspack/binding-linux-x64-musl": "npm:2.1.4"
"@rspack/binding-wasm32-wasi": "npm:2.1.4"
"@rspack/binding-win32-arm64-msvc": "npm:2.1.4"
"@rspack/binding-win32-ia32-msvc": "npm:2.1.4"
"@rspack/binding-win32-x64-msvc": "npm:2.1.4"
"@rspack/binding-darwin-arm64": "npm:2.1.5"
"@rspack/binding-darwin-x64": "npm:2.1.5"
"@rspack/binding-linux-arm64-gnu": "npm:2.1.5"
"@rspack/binding-linux-arm64-musl": "npm:2.1.5"
"@rspack/binding-linux-riscv64-gnu": "npm:2.1.5"
"@rspack/binding-linux-riscv64-musl": "npm:2.1.5"
"@rspack/binding-linux-x64-gnu": "npm:2.1.5"
"@rspack/binding-linux-x64-musl": "npm:2.1.5"
"@rspack/binding-wasm32-wasi": "npm:2.1.5"
"@rspack/binding-win32-arm64-msvc": "npm:2.1.5"
"@rspack/binding-win32-ia32-msvc": "npm:2.1.5"
"@rspack/binding-win32-x64-msvc": "npm:2.1.5"
dependenciesMeta:
"@rspack/binding-darwin-arm64":
optional: true
@@ -4884,15 +4884,15 @@ __metadata:
optional: true
"@rspack/binding-win32-x64-msvc":
optional: true
checksum: 10/425bf152dba708992ce16114ce6bc8dfa424071694e85201317518dce1899eeae873a2adbd23b214bb8d223f7290e000fd78ad9bf262c633e12d3d4ff73bbdcd
checksum: 10/d1054348d3ba734485f977d574c6311311707adfcc5e53f03c8dbbbdc5778cff9b815e1d675992e2832241606d4cce7678acc3999b259139120b4ec30751f1e1
languageName: node
linkType: hard
"@rspack/core@npm:2.1.4":
version: 2.1.4
resolution: "@rspack/core@npm:2.1.4"
"@rspack/core@npm:2.1.5":
version: 2.1.5
resolution: "@rspack/core@npm:2.1.5"
dependencies:
"@rspack/binding": "npm:2.1.4"
"@rspack/binding": "npm:2.1.5"
peerDependencies:
"@module-federation/runtime-tools": ^0.24.1 || ^2.0.0
"@swc/helpers": ^0.5.23
@@ -4901,7 +4901,7 @@ __metadata:
optional: true
"@swc/helpers":
optional: true
checksum: 10/3c7aa9e8dbe8b132b51fc017a6c2c76ddf346cf663cad2a8912ba61469d80468acd045503d405bf962bb5ec44f44036512dd6d6233ea6d1419979e5c17e1dbd8
checksum: 10/714064de701211724f7d859bc269d357fa2ad2f7ea0ac34d1e4e48b534981cf3961bd723c0659b9c093330f04e01e16a0c5587d6a18301727e27d717f764ded7
languageName: node
linkType: hard
@@ -9955,7 +9955,7 @@ __metadata:
"@playwright/test": "npm:1.61.1"
"@replit/codemirror-indentation-markers": "npm:6.5.3"
"@rsdoctor/rspack-plugin": "npm:1.6.1"
"@rspack/core": "npm:2.1.4"
"@rspack/core": "npm:2.1.5"
"@rspack/dev-server": "npm:2.1.0"
"@swc/helpers": "npm:0.5.23"
"@thomasloven/round-slider": "npm:0.6.0"