From 7fdf824e97bb972e9214b2c7ac868b35a5a9d33d Mon Sep 17 00:00:00 2001 From: karwosts <32912880+karwosts@users.noreply.github.com> Date: Thu, 10 Jul 2025 12:33:33 -0700 Subject: [PATCH 1/6] Revert changes to persistent notification in sidebar (#25984) --- src/components/ha-sidebar.ts | 31 ++++++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/src/components/ha-sidebar.ts b/src/components/ha-sidebar.ts index 8ccaad0d95..d097a57ce0 100644 --- a/src/components/ha-sidebar.ts +++ b/src/components/ha-sidebar.ts @@ -14,6 +14,7 @@ import { mdiTooltipAccount, mdiViewDashboard, } from "@mdi/js"; +import type { UnsubscribeFunc } from "home-assistant-js-websocket"; import type { CSSResultGroup, PropertyValues } from "lit"; import { LitElement, css, html, nothing } from "lit"; import { @@ -205,6 +206,8 @@ class HaSidebar extends SubscribeMixin(LitElement) { private _recentKeydownActiveUntil = 0; + private _unsubPersistentNotifications: UnsubscribeFunc | undefined; + @query(".tooltip") private _tooltip!: HTMLDivElement; public hassSubscribe() { @@ -227,9 +230,6 @@ class HaSidebar extends SubscribeMixin(LitElement) { } } ), - subscribeNotifications(this.hass.connection, (notifications) => { - this._notifications = notifications; - }), ...(this.hass.user?.is_admin ? [ subscribeRepairsIssueRegistry(this.hass.connection!, (repairs) => { @@ -300,6 +300,23 @@ class HaSidebar extends SubscribeMixin(LitElement) { ); } + protected firstUpdated(changedProps: PropertyValues) { + super.firstUpdated(changedProps); + this._subscribePersistentNotifications(); + } + + private _subscribePersistentNotifications(): void { + if (this._unsubPersistentNotifications) { + this._unsubPersistentNotifications(); + } + this._unsubPersistentNotifications = subscribeNotifications( + this.hass.connection, + (notifications) => { + this._notifications = notifications; + } + ); + } + protected updated(changedProps) { super.updated(changedProps); if (changedProps.has("alwaysExpand")) { @@ -311,6 +328,14 @@ class HaSidebar extends SubscribeMixin(LitElement) { const oldHass = changedProps.get("hass") as HomeAssistant | undefined; + if ( + this.hass && + oldHass?.connected === false && + this.hass.connected === true + ) { + this._subscribePersistentNotifications(); + } + this._calculateCounts(); if (!SUPPORT_SCROLL_IF_NEEDED) { From b87fbe7a1eb060b31b3b1de1c9e6b76a6c4d2fe4 Mon Sep 17 00:00:00 2001 From: karwosts <32912880+karwosts@users.noreply.github.com> Date: Fri, 4 Jul 2025 14:34:38 -0700 Subject: [PATCH 2/6] Fix default range icon (#26069) --- src/data/icons.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/data/icons.ts b/src/data/icons.ts index 4c6699c038..c42b8e0f21 100644 --- a/src/data/icons.ts +++ b/src/data/icons.ts @@ -354,7 +354,10 @@ const getIconFromTranslations = ( } // Then check for range-based icons if we have a numeric state if (state !== undefined && translations.range && !isNaN(Number(state))) { - return getIconFromRange(Number(state), translations.range); + return ( + getIconFromRange(Number(state), translations.range) ?? + translations.default + ); } // Fallback to default icon return translations.default; @@ -518,7 +521,10 @@ export const domainIcon = async ( } // Then check for range-based icons if we have a numeric state if (state !== undefined && translations.range && !isNaN(Number(state))) { - return getIconFromRange(Number(state), translations.range); + return ( + getIconFromRange(Number(state), translations.range) ?? + translations.default + ); } // Fallback to default icon return translations.default; From 761fded9e3567d6eb6a19f5ea011c70b36c9a13e Mon Sep 17 00:00:00 2001 From: Yosi Levy <37745463+yosilevy@users.noreply.github.com> Date: Sun, 6 Jul 2025 11:04:09 +0300 Subject: [PATCH 3/6] RTL fixes for 7-25 (#26074) --- src/panels/config/dashboard/dashboard-card.ts | 2 +- .../config/integrations/ha-config-integration-page.ts | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/panels/config/dashboard/dashboard-card.ts b/src/panels/config/dashboard/dashboard-card.ts index b737152442..663500dc33 100644 --- a/src/panels/config/dashboard/dashboard-card.ts +++ b/src/panels/config/dashboard/dashboard-card.ts @@ -58,7 +58,7 @@ export class DashboardCard extends LitElement { .card-header { padding: 12px; display: block; - text-align: left; + text-align: var(--float-start); gap: 8px; } .preview { diff --git a/src/panels/config/integrations/ha-config-integration-page.ts b/src/panels/config/integrations/ha-config-integration-page.ts index 744b3fd181..74f5be55d6 100644 --- a/src/panels/config/integrations/ha-config-integration-page.ts +++ b/src/panels/config/integrations/ha-config-integration-page.ts @@ -907,7 +907,7 @@ class HaConfigIntegrationPage extends SubscribeMixin(LitElement) { justify-content: space-between; } .title h1 { - font-family: Roboto; + font-family: var(--ha-font-family-body); font-size: 32px; font-weight: 700; line-height: 40px; @@ -938,6 +938,8 @@ class HaConfigIntegrationPage extends SubscribeMixin(LitElement) { display: flex; justify-content: center; margin-right: 16px; + margin-inline-end: 16px; + margin-inline-start: initial; padding: 0 8px; } .logo-container img { @@ -971,7 +973,7 @@ class HaConfigIntegrationPage extends SubscribeMixin(LitElement) { margin-inline-start: 16px; margin-top: 6px; margin-bottom: 6px; - font-family: Roboto; + font-family: var(--ha-font-family-body); font-size: 14px; font-weight: 500; line-height: 20px; From c10410ade31108fd04578c368f04fa4d72a62464 Mon Sep 17 00:00:00 2001 From: Ezra Freedman <38084742+ezra-freedman@users.noreply.github.com> Date: Sun, 6 Jul 2025 04:12:59 -0400 Subject: [PATCH 4/6] Weather card smallest width is not set correctly (#26082) set result.width, not result.height --- src/panels/lovelace/cards/hui-weather-forecast-card.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/panels/lovelace/cards/hui-weather-forecast-card.ts b/src/panels/lovelace/cards/hui-weather-forecast-card.ts index 7c2759102d..aa5d4ff488 100644 --- a/src/panels/lovelace/cards/hui-weather-forecast-card.ts +++ b/src/panels/lovelace/cards/hui-weather-forecast-card.ts @@ -82,7 +82,7 @@ class HuiWeatherForecastCard extends LitElement implements LovelaceCard { const width = entries[0]?.contentRect.width; if (width < 245) { - result.height = "very-very-narrow"; + result.width = "very-very-narrow"; } else if (width < 300) { result.width = "very-narrow"; } else if (width < 375) { @@ -93,7 +93,6 @@ class HuiWeatherForecastCard extends LitElement implements LovelaceCard { if (height < 235) { result.height = "short"; } - return result; }, }); From 61fe8983f38dce04b57fbb132ba079db9792f8d3 Mon Sep 17 00:00:00 2001 From: Christoph <15820871+chrisv-dev@users.noreply.github.com> Date: Tue, 8 Jul 2025 12:40:24 +0200 Subject: [PATCH 5/6] do not set "___ADD_NEW___" value in ha-floor-picker (#26102) --- src/components/ha-floor-picker.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/ha-floor-picker.ts b/src/components/ha-floor-picker.ts index 84617c46e4..9eef8a2274 100644 --- a/src/components/ha-floor-picker.ts +++ b/src/components/ha-floor-picker.ts @@ -433,6 +433,7 @@ export class HaFloorPicker extends LitElement { } }, }); + return; } this._setValue(value); From a87afe9fb3d374f19e36690972024b34b0489899 Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Thu, 10 Jul 2025 21:34:53 +0200 Subject: [PATCH 6/6] Bumped version to 20250702.2 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index e83908af4e..d5ef09e5da 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "home-assistant-frontend" -version = "20250702.1" +version = "20250702.2" license = "Apache-2.0" license-files = ["LICENSE*"] description = "The Home Assistant frontend"