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" 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); 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) { 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; 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; 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; }, });