Skip to content

Commit 95c3013

Browse files
committed
Merge branch 'rc'
2 parents 7f6ce97 + 69a156f commit 95c3013

17 files changed

+123
-40
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "home-assistant-frontend"
7-
version = "20250509.0"
7+
version = "20250516.0"
88
license = "Apache-2.0"
99
license-files = ["LICENSE*"]
1010
description = "The Home Assistant frontend"

src/components/entity/ha-entity-combo-box.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,9 @@ export class HaEntityComboBox extends LitElement {
178178
: nothing}
179179
${item.domain_name && !showEntityId
180180
? html`
181-
<div slot="trailing-supporting-text">${item.domain_name}</div>
181+
<div slot="trailing-supporting-text" class="domain">
182+
${item.domain_name}
183+
</div>
182184
`
183185
: nothing}
184186
</ha-combo-box-item>
@@ -408,7 +410,9 @@ export class HaEntityComboBox extends LitElement {
408410
protected render(): TemplateResult {
409411
return html`
410412
<ha-combo-box
413+
item-id-path="id"
411414
item-value-path="id"
415+
item-label-path="label"
412416
.hass=${this.hass}
413417
.value=${this._value}
414418
.label=${this.label === undefined

src/components/entity/ha-entity-picker.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
import { mdiClose, mdiMenuDown, mdiShape } from "@mdi/js";
22
import type { ComboBoxLightOpenedChangedEvent } from "@vaadin/combo-box/vaadin-combo-box-light";
3-
import { css, html, LitElement, nothing, type CSSResultGroup } from "lit";
3+
import {
4+
css,
5+
html,
6+
LitElement,
7+
nothing,
8+
type CSSResultGroup,
9+
type PropertyValues,
10+
} from "lit";
411
import { customElement, property, query, state } from "lit/decorators";
512
import { fireEvent } from "../../common/dom/fire_event";
613
import { stopPropagation } from "../../common/dom/stop_propagation";
@@ -106,6 +113,12 @@ export class HaEntityPicker extends LitElement {
106113

107114
@state() private _opened = false;
108115

116+
protected firstUpdated(changedProperties: PropertyValues): void {
117+
super.firstUpdated(changedProperties);
118+
// Load title translations so it is available when the combo-box opens
119+
this.hass.loadBackendTranslation("title");
120+
}
121+
109122
private _renderContent() {
110123
const entityId = this.value || "";
111124

src/components/entity/ha-statistic-combo-box.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,9 @@ export class HaStatisticComboBox extends LitElement {
396396

397397
return html`
398398
<ha-combo-box
399+
item-id-path="id"
400+
item-value-path="id"
401+
item-label-path="label"
399402
.hass=${this.hass}
400403
.label=${this.label === undefined && this.hass
401404
? this.hass.localize("ui.components.statistic-picker.statistic")
@@ -405,9 +408,6 @@ export class HaStatisticComboBox extends LitElement {
405408
.disabled=${this.disabled}
406409
.allowCustomValue=${this.allowCustomEntity}
407410
.filteredItems=${this._items}
408-
item-value-path="id"
409-
item-id-path="id"
410-
item-label-path="label"
411411
@opened-changed=${this._openedChanged}
412412
@value-changed=${this._statisticChanged}
413413
@filter-changed=${this._filterChanged}

src/components/ha-combo-box-item.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export class HaComboBoxItem extends HaMdListItem {
3939
font-family: var(--ha-font-family-code);
4040
font-size: var(--ha-font-size-xs);
4141
}
42-
[slot="trailing-supporting-text"] {
42+
::slotted(.domain) {
4343
font-size: var(--ha-font-size-s);
4444
font-weight: var(--ha-font-weight-normal);
4545
line-height: var(--ha-line-height-normal);

src/data/system_health.ts

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,29 @@ export type SystemCheckValue =
2626
| boolean
2727
| SystemCheckValueObject;
2828

29-
export type SystemHealthInfo = Record<
30-
string,
31-
{
29+
export type SystemHealthInfo = Partial<{
30+
homeassistant: {
31+
info: {
32+
version: string;
33+
installation_type: string;
34+
dev: boolean;
35+
hassio: boolean;
36+
docker: boolean;
37+
user: string;
38+
virtualenv: boolean;
39+
python_version: string;
40+
os_name: string;
41+
os_version: string;
42+
arch: string;
43+
timezone: string;
44+
config_dir: string;
45+
};
46+
};
47+
[domain: string]: {
3248
manage_url?: string;
3349
info: Record<string, SystemCheckValue>;
34-
}
35-
>;
50+
};
51+
}>;
3652

3753
interface SystemHealthEventInitial {
3854
type: "initial";

src/dialogs/quick-bar/ha-quick-bar.ts

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,50 +9,50 @@ import {
99
mdiReload,
1010
mdiServerNetwork,
1111
} from "@mdi/js";
12+
import Fuse from "fuse.js";
1213
import type { TemplateResult } from "lit";
1314
import { css, html, LitElement, nothing } from "lit";
1415
import { customElement, property, query, state } from "lit/decorators";
1516
import { ifDefined } from "lit/directives/if-defined";
1617
import { styleMap } from "lit/directives/style-map";
1718
import memoizeOne from "memoize-one";
18-
import Fuse from "fuse.js";
1919
import { canShowPage } from "../../common/config/can_show_page";
2020
import { componentsWithService } from "../../common/config/components_with_service";
2121
import { isComponentLoaded } from "../../common/config/is_component_loaded";
2222
import { fireEvent } from "../../common/dom/fire_event";
23+
import { computeAreaName } from "../../common/entity/compute_area_name";
2324
import {
2425
computeDeviceName,
2526
computeDeviceNameDisplay,
2627
} from "../../common/entity/compute_device_name";
28+
import { computeDomain } from "../../common/entity/compute_domain";
29+
import { computeEntityName } from "../../common/entity/compute_entity_name";
30+
import { computeStateName } from "../../common/entity/compute_state_name";
31+
import { getEntityContext } from "../../common/entity/context/get_entity_context";
2732
import { navigate } from "../../common/navigate";
2833
import { caseInsensitiveStringCompare } from "../../common/string/compare";
2934
import type { ScorableTextItem } from "../../common/string/filter/sequence-matching";
35+
import { computeRTL } from "../../common/util/compute_rtl";
3036
import { debounce } from "../../common/util/debounce";
3137
import "../../components/ha-icon-button";
3238
import "../../components/ha-label";
3339
import "../../components/ha-list";
40+
import "../../components/ha-md-list-item";
3441
import "../../components/ha-spinner";
3542
import "../../components/ha-textfield";
3643
import "../../components/ha-tip";
37-
import "../../components/ha-md-list-item";
3844
import { fetchHassioAddonsInfo } from "../../data/hassio/addon";
3945
import { domainToName } from "../../data/integration";
4046
import { getPanelNameTranslationKey } from "../../data/panel";
4147
import type { PageNavigation } from "../../layouts/hass-tabs-subpage";
4248
import { configSections } from "../../panels/config/ha-panel-config";
49+
import { HaFuse } from "../../resources/fuse";
4350
import { haStyleDialog, haStyleScrollbar } from "../../resources/styles";
4451
import { loadVirtualizer } from "../../resources/virtualizer";
4552
import type { HomeAssistant } from "../../types";
4653
import { showConfirmationDialog } from "../generic/show-dialog-box";
4754
import { showShortcutsDialog } from "../shortcuts/show-shortcuts-dialog";
4855
import { QuickBarMode, type QuickBarParams } from "./show-dialog-quick-bar";
49-
import { getEntityContext } from "../../common/entity/context/get_entity_context";
50-
import { computeEntityName } from "../../common/entity/compute_entity_name";
51-
import { computeAreaName } from "../../common/entity/compute_area_name";
52-
import { computeRTL } from "../../common/util/compute_rtl";
53-
import { computeDomain } from "../../common/entity/compute_domain";
54-
import { computeStateName } from "../../common/entity/compute_state_name";
55-
import { HaFuse } from "../../resources/fuse";
5656

5757
interface QuickBarItem extends ScorableTextItem {
5858
primaryText: string;
@@ -152,11 +152,6 @@ export class QuickBar extends LitElement {
152152
}
153153
}
154154

155-
protected firstUpdated(changedProps) {
156-
super.firstUpdated(changedProps);
157-
this.hass.loadBackendTranslation("title");
158-
}
159-
160155
private _getItems = memoizeOne(
161156
(
162157
mode: QuickBarMode,
@@ -304,7 +299,8 @@ export class QuickBar extends LitElement {
304299
} else if (this._mode === QuickBarMode.Device) {
305300
this._deviceItems = this._deviceItems || this._generateDeviceItems();
306301
} else {
307-
this._entityItems = this._entityItems || this._generateEntityItems();
302+
this._entityItems =
303+
this._entityItems || (await this._generateEntityItems());
308304
}
309305
}
310306

@@ -386,7 +382,7 @@ export class QuickBar extends LitElement {
386382
`
387383
: nothing}
388384
${item.translatedDomain && !showEntityId
389-
? html`<div slot="trailing-supporting-text">
385+
? html`<div slot="trailing-supporting-text" class="domain">
390386
${item.translatedDomain}
391387
</div>`
392388
: nothing}
@@ -581,9 +577,11 @@ export class QuickBar extends LitElement {
581577
);
582578
}
583579

584-
private _generateEntityItems(): EntityItem[] {
580+
private async _generateEntityItems(): Promise<EntityItem[]> {
585581
const isRTL = computeRTL(this.hass);
586582

583+
await this.hass.loadBackendTranslation("title");
584+
587585
return Object.keys(this.hass.states)
588586
.map((entityId) => {
589587
const stateObj = this.hass.states[entityId];
@@ -1027,7 +1025,7 @@ export class QuickBar extends LitElement {
10271025
font-size: var(--ha-font-size-xs);
10281026
}
10291027
1030-
ha-md-list-item [slot="trailing-supporting-text"] {
1028+
ha-md-list-item .domain {
10311029
font-size: var(--ha-font-size-s);
10321030
font-weight: var(--ha-font-weight-normal);
10331031
line-height: var(--ha-line-height-normal);

src/dialogs/voice-command-dialog/ha-voice-command-dialog.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,16 +57,22 @@ export class HaVoiceCommandDialog extends LitElement {
5757
public async showDialog(
5858
params: Required<VoiceCommandDialogParams>
5959
): Promise<void> {
60+
await this._loadPipelines();
61+
const pipelinesIds = this._pipelines?.map((pipeline) => pipeline.id) || [];
6062
if (
6163
params.pipeline_id === "preferred" ||
6264
(params.pipeline_id === "last_used" && !this._pipelineId)
6365
) {
64-
await this._loadPipelines();
6566
this._pipelineId = this._preferredPipeline;
6667
} else if (!["last_used", "preferred"].includes(params.pipeline_id)) {
6768
this._pipelineId = params.pipeline_id;
6869
}
6970

71+
// If the pipeline id is not in the list of pipelines, set it to preferred
72+
if (this._pipelineId && !pipelinesIds.includes(this._pipelineId)) {
73+
this._pipelineId = this._preferredPipeline;
74+
}
75+
7076
this._startListening = params.start_listening;
7177
this._opened = true;
7278
}

src/panels/config/automation/action/types/ha-automation-action-choose.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ export class HaChooseAction extends LitElement implements ActionElement {
1818

1919
@property({ attribute: false }) public action!: ChooseAction;
2020

21+
@property({ type: Boolean }) public narrow = false;
22+
2123
@state() private _showDefault = false;
2224

2325
public static get defaultConfig(): ChooseAction {
@@ -35,6 +37,7 @@ export class HaChooseAction extends LitElement implements ActionElement {
3537
.disabled=${this.disabled}
3638
@value-changed=${this._optionsChanged}
3739
.hass=${this.hass}
40+
.narrow=${this.narrow}
3841
></ha-automation-option>
3942
4043
${this._showDefault || action.default
@@ -49,6 +52,7 @@ export class HaChooseAction extends LitElement implements ActionElement {
4952
.disabled=${this.disabled}
5053
@value-changed=${this._defaultChanged}
5154
.hass=${this.hass}
55+
.narrow=${this.narrow}
5256
></ha-automation-action>
5357
`
5458
: html`

src/panels/config/automation/action/types/ha-automation-action-if.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ export class HaIfAction extends LitElement implements ActionElement {
1818

1919
@property({ attribute: false }) public action!: IfAction;
2020

21+
@property({ type: Boolean }) public narrow = false;
22+
2123
@state() private _showElse = false;
2224

2325
public static get defaultConfig(): IfAction {
@@ -41,6 +43,7 @@ export class HaIfAction extends LitElement implements ActionElement {
4143
.disabled=${this.disabled}
4244
@value-changed=${this._ifChanged}
4345
.hass=${this.hass}
46+
.narrow=${this.narrow}
4447
></ha-automation-condition>
4548
4649
<h3>
@@ -53,6 +56,7 @@ export class HaIfAction extends LitElement implements ActionElement {
5356
.disabled=${this.disabled}
5457
@value-changed=${this._thenChanged}
5558
.hass=${this.hass}
59+
.narrow=${this.narrow}
5660
></ha-automation-action>
5761
${this._showElse || action.else
5862
? html`
@@ -66,6 +70,7 @@ export class HaIfAction extends LitElement implements ActionElement {
6670
.disabled=${this.disabled}
6771
@value-changed=${this._elseChanged}
6872
.hass=${this.hass}
73+
.narrow=${this.narrow}
6974
></ha-automation-action>
7075
`
7176
: html` <div class="link-button-row">

src/panels/config/automation/option/ha-automation-option-row.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@ export default class HaAutomationOptionRow extends LitElement {
183183
)}
184184
.disabled=${this.disabled}
185185
.hass=${this.hass}
186+
.narrow=${this.narrow}
186187
@value-changed=${this._conditionChanged}
187188
></ha-automation-condition>
188189
<h4>
@@ -194,6 +195,7 @@ export default class HaAutomationOptionRow extends LitElement {
194195
.actions=${ensureArray(this.option.sequence) || []}
195196
.disabled=${this.disabled}
196197
.hass=${this.hass}
198+
.narrow=${this.narrow}
197199
@value-changed=${this._actionChanged}
198200
></ha-automation-action>
199201
</div>

src/panels/config/info/ha-config-info.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import { mdiHomeAssistant } from "../../../resources/home-assistant-logo-svg";
2929
import { haStyle } from "../../../resources/styles";
3030
import type { HomeAssistant, Route } from "../../../types";
3131
import { documentationUrl } from "../../../util/documentation-url";
32+
import { subscribeSystemHealthInfo } from "../../../data/system_health";
3233

3334
const JS_TYPE = __BUILD__;
3435
const JS_VERSION = __VERSION__;
@@ -99,6 +100,8 @@ class HaConfigInfo extends LitElement {
99100

100101
@state() private _hassioInfo?: HassioInfo;
101102

103+
@state() private _installationMethod?: string;
104+
102105
protected render(): TemplateResult {
103106
const hass = this.hass;
104107
const customUiList: { name: string; url: string; version: string }[] =
@@ -127,6 +130,14 @@ class HaConfigInfo extends LitElement {
127130
</a>
128131
<p>Home Assistant</p>
129132
<ul class="versions">
133+
<li>
134+
<span class="version-label"
135+
>${this.hass.localize(
136+
`ui.panel.config.info.installation_method`
137+
)}</span
138+
>
139+
<span class="version">${this._installationMethod || "…"}</span>
140+
</li>
130141
<li>
131142
<span class="version-label">Core</span>
132143
<span class="version">${hass.connection.haVersion}</span>
@@ -249,6 +260,13 @@ class HaConfigInfo extends LitElement {
249260
if (isComponentLoaded(this.hass, "hassio")) {
250261
this._loadSupervisorInfo();
251262
}
263+
264+
const unsubSystemHealth = subscribeSystemHealthInfo(this.hass, (info) => {
265+
if (info?.homeassistant) {
266+
this._installationMethod = info.homeassistant.info.installation_type;
267+
unsubSystemHealth.then((unsub) => unsub());
268+
}
269+
});
252270
}
253271

254272
private async _loadSupervisorInfo(): Promise<void> {

src/panels/config/repairs/dialog-system-information.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ class DialogSystemInformation extends LitElement {
301301
} else {
302302
const domains = Object.keys(this._systemInfo).sort(sortKeys);
303303
for (const domain of domains) {
304-
const domainInfo = this._systemInfo[domain];
304+
const domainInfo = this._systemInfo[domain]!;
305305
const keys: TemplateResult[] = [];
306306

307307
for (const key of Object.keys(domainInfo.info)) {
@@ -387,7 +387,7 @@ class DialogSystemInformation extends LitElement {
387387
const domainParts: string[] = [];
388388

389389
for (const domain of Object.keys(this._systemInfo!).sort(sortKeys)) {
390-
const domainInfo = this._systemInfo![domain];
390+
const domainInfo = this._systemInfo![domain]!;
391391
let first = true;
392392
const parts = [
393393
`${

0 commit comments

Comments
 (0)