From de56c3376e257fe92b8a34b438de579be1a32be8 Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Mon, 26 May 2025 18:32:32 +0200 Subject: [PATCH 001/389] Bumped version to 20250526.0 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 169b86dbe8..9bc7f1e919 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "home-assistant-frontend" -version = "20250430.0" +version = "20250526.0" license = "Apache-2.0" license-files = ["LICENSE*"] description = "The Home Assistant frontend" From 1611423ca5fbdd14d07d866065af1fc9c5e3b3e1 Mon Sep 17 00:00:00 2001 From: Paul Bottein Date: Mon, 26 May 2025 19:21:44 +0200 Subject: [PATCH 002/389] Fix duplicated items in strategy editor (#25600) --- src/components/ha-items-display-editor.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/ha-items-display-editor.ts b/src/components/ha-items-display-editor.ts index 77e1dfff35..e87ecfaef0 100644 --- a/src/components/ha-items-display-editor.ts +++ b/src/components/ha-items-display-editor.ts @@ -262,7 +262,7 @@ export class HaItemDisplayEditor extends LitElement { ]; } - return items.sort((a, b) => + return visibleItems.sort((a, b) => a.disableSorting && !b.disableSorting ? -1 : compare(a.value, b.value) ); } From 9131bf6dfd234b553a7f6b2c951431669ee6ba2c Mon Sep 17 00:00:00 2001 From: Petar Petrov Date: Tue, 27 May 2025 10:08:58 +0300 Subject: [PATCH 003/389] Fix double history graphs for a disabled entity (#25604) --- src/data/history.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/data/history.ts b/src/data/history.ts index fb784b54f4..553421d404 100644 --- a/src/data/history.ts +++ b/src/data/history.ts @@ -640,6 +640,12 @@ export const mergeHistoryResults = ( } for (const item of ltsResult.line) { + if (item.unit === BLANK_UNIT) { + // disabled entities have no unit, so we need to find the unit from the history result + item.unit = + historyResult.line.find((line) => line.identifier === item.identifier) + ?.unit ?? BLANK_UNIT; + } const key = computeGroupKey( item.unit, item.device_class, From 1a57eeddde9034b01fad9738eb1b432fa158e710 Mon Sep 17 00:00:00 2001 From: Wendelin <12148533+wendevlin@users.noreply.github.com> Date: Tue, 27 May 2025 10:22:04 +0200 Subject: [PATCH 004/389] Fix sidebar loading and demo (#25606) --- demo/src/stubs/frontend.ts | 23 +++++++++++++++++++++++ src/components/ha-sidebar.ts | 2 +- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/demo/src/stubs/frontend.ts b/demo/src/stubs/frontend.ts index ae4ac073fd..70a4d5a0d2 100644 --- a/demo/src/stubs/frontend.ts +++ b/demo/src/stubs/frontend.ts @@ -1,7 +1,30 @@ import type { MockHomeAssistant } from "../../../src/fake_data/provide_hass"; +let changeFunction; + export const mockFrontend = (hass: MockHomeAssistant) => { hass.mockWS("frontend/get_user_data", () => ({ value: null, })); + hass.mockWS("frontend/set_user_data", ({ key, value }) => { + if (key === "sidebar") { + changeFunction?.({ + value: { + panelOrder: value.panelOrder || [], + hiddenPanels: value.hiddenPanels || [], + }, + }); + } + }); + hass.mockWS("frontend/subscribe_user_data", (_msg, _hass, onChange) => { + changeFunction = onChange; + onChange?.({ + value: { + panelOrder: [], + hiddenPanels: [], + }, + }); + // eslint-disable-next-line @typescript-eslint/no-empty-function + return () => {}; + }); }; diff --git a/src/components/ha-sidebar.ts b/src/components/ha-sidebar.ts index d2f77a9770..ea303ab4c8 100644 --- a/src/components/ha-sidebar.ts +++ b/src/components/ha-sidebar.ts @@ -368,7 +368,7 @@ class HaSidebar extends SubscribeMixin(LitElement) { if (!this._panelOrder || !this._hiddenPanels) { return html` `; } From 77ee69b64d1cf61ff653fce96adfa8c1102fcece Mon Sep 17 00:00:00 2001 From: Wendelin <12148533+wendevlin@users.noreply.github.com> Date: Tue, 27 May 2025 12:55:20 +0200 Subject: [PATCH 005/389] Fix font settings for button card (#25607) --- src/panels/lovelace/cards/hui-button-card.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/panels/lovelace/cards/hui-button-card.ts b/src/panels/lovelace/cards/hui-button-card.ts index f6cc9b0bcd..957c8a868b 100644 --- a/src/panels/lovelace/cards/hui-button-card.ts +++ b/src/panels/lovelace/cards/hui-button-card.ts @@ -224,19 +224,19 @@ export class HuiButtonCard extends LitElement implements LovelaceCard { filter: colored ? stateColorBrightness(stateObj) : undefined, height: this._config.icon_height ? this._config.icon_height - : "", + : undefined, })} > ` - : ""} + : nothing} ${this._config.show_name ? html`${name}` - : ""} + : nothing} ${this._config.show_state && stateObj ? html` ${this.hass.formatEntityState(stateObj)} ` - : ""} + : nothing} `; } @@ -282,7 +282,8 @@ export class HuiButtonCard extends LitElement implements LovelaceCard { align-items: center; text-align: center; padding: 4% 0; - font-size: 16.8px; + font-size: var(--ha-font-size-l); + line-height: var(--ha-line-height-condensed); height: 100%; box-sizing: border-box; justify-content: center; From 116716c51da210677e7313e4a82589d94be40c7f Mon Sep 17 00:00:00 2001 From: Petar Petrov Date: Tue, 27 May 2025 21:43:32 +0300 Subject: [PATCH 006/389] Fix duplicate legend items when comparing energy data (#25610) --- src/components/chart/ha-chart-base.ts | 40 ++++++++++++------- .../hui-energy-devices-detail-graph-card.ts | 18 +++++++++ 2 files changed, 44 insertions(+), 14 deletions(-) diff --git a/src/components/chart/ha-chart-base.ts b/src/components/chart/ha-chart-base.ts index 64db12b3df..2ecad752a3 100644 --- a/src/components/chart/ha-chart-base.ts +++ b/src/components/chart/ha-chart-base.ts @@ -220,11 +220,11 @@ export class HaChartBase extends LitElement { return nothing; } const datasets = ensureArray(this.data); - const items = (legend.data || - datasets + const items: LegendComponentOption["data"] = + legend.data || + ((datasets .filter((d) => (d.data as any[])?.length && (d.id || d.name)) - .map((d) => d.name ?? d.id) || - []) as string[]; + .map((d) => d.name ?? d.id) || []) as string[]); const isMobile = window.matchMedia( "all and (max-width: 450px), all and (max-height: 500px)" @@ -239,20 +239,32 @@ export class HaChartBase extends LitElement { })} >