mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-13 12:26:35 +00:00
Merge branch 'rc'
This commit is contained in:
commit
6a3c58d20f
@ -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"
|
||||
|
@ -433,6 +433,7 @@ export class HaFloorPicker extends LitElement {
|
||||
}
|
||||
},
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
this._setValue(value);
|
||||
|
@ -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) {
|
||||
|
@ -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;
|
||||
|
@ -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 {
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
},
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user