From 7631c409e1c3c39e03c837dfeca36970dca83f41 Mon Sep 17 00:00:00 2001 From: dcapslock Date: Mon, 14 Jul 2025 15:42:37 +1000 Subject: [PATCH 1/6] Improve performance of Helpers config page (#26153) --- .../config/helpers/ha-config-helpers.ts | 25 +++++++++---------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/src/panels/config/helpers/ha-config-helpers.ts b/src/panels/config/helpers/ha-config-helpers.ts index 5e4e386f52..2548e0d2aa 100644 --- a/src/panels/config/helpers/ha-config-helpers.ts +++ b/src/panels/config/helpers/ha-config-helpers.ts @@ -74,6 +74,7 @@ import type { UpdateEntityRegistryEntryResult, } from "../../../data/entity_registry"; import { + entityRegistryByEntityId, subscribeEntityRegistry, updateEntityRegistryEntry, } from "../../../data/entity_registry"; @@ -520,9 +521,8 @@ export class HaConfigHelpers extends SubscribeMixin(LitElement) { : true ) .map((item) => { - const entityRegEntry = entityReg.find( - (reg) => reg.entity_id === item.entity_id - ); + const entityRegEntry = + entityRegistryByEntityId(entityReg)[item.entity_id]; const labels = labelReg && entityRegEntry?.labels; const category = entityRegEntry?.categories.helpers; return { @@ -547,7 +547,7 @@ export class HaConfigHelpers extends SubscribeMixin(LitElement) { private _labelsForEntity(entityId: string): string[] { return ( this.hass.entities[entityId]?.labels || - this._entityReg.find((e) => e.entity_id === entityId)?.labels || + entityRegistryByEntityId(this._entityReg)[entityId]?.labels || [] ); } @@ -885,9 +885,9 @@ export class HaConfigHelpers extends SubscribeMixin(LitElement) { const labelItems = new Set(); this._stateItems .filter((stateItem) => - this._entityReg - .find((reg) => reg.entity_id === stateItem.entity_id) - ?.labels.some((lbl) => filter.includes(lbl)) + entityRegistryByEntityId(this._entityReg)[ + stateItem.entity_id + ]?.labels.some((lbl) => filter.includes(lbl)) ) .forEach((stateItem) => labelItems.add(stateItem.entity_id)); (this._disabledEntityEntries || []) @@ -913,9 +913,8 @@ export class HaConfigHelpers extends SubscribeMixin(LitElement) { .filter( (stateItem) => filter[0] === - this._entityReg.find( - (reg) => reg.entity_id === stateItem.entity_id - )?.categories.helpers + entityRegistryByEntityId(this._entityReg)[stateItem.entity_id] + ?.categories.helpers ) .forEach((stateItem) => categoryItems.add(stateItem.entity_id)); (this._disabledEntityEntries || []) @@ -943,9 +942,9 @@ export class HaConfigHelpers extends SubscribeMixin(LitElement) { } private _editCategory(helper: any) { - const entityReg = this._entityReg.find( - (reg) => reg.entity_id === helper.entity_id - ); + const entityReg = entityRegistryByEntityId(this._entityReg)[ + helper.entity_id + ]; if (!entityReg) { showAlertDialog(this, { title: this.hass.localize( From 4c940e62f360e6261a382e51c0d51b9956298a40 Mon Sep 17 00:00:00 2001 From: Petar Petrov Date: Fri, 18 Jul 2025 11:01:33 +0300 Subject: [PATCH 2/6] Fix entities link on integration page (#26167) --- .../config/integrations/ha-config-entry-device-row.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/panels/config/integrations/ha-config-entry-device-row.ts b/src/panels/config/integrations/ha-config-entry-device-row.ts index 6783240f46..69afc14122 100644 --- a/src/panels/config/integrations/ha-config-entry-device-row.ts +++ b/src/panels/config/integrations/ha-config-entry-device-row.ts @@ -115,9 +115,7 @@ class HaConfigEntryDeviceRow extends LitElement { : nothing} ${entities.length ? html` - + Date: Tue, 15 Jul 2025 19:40:23 +0300 Subject: [PATCH 3/6] Fix number format in statistics charts (#26176) fix number format in statistics charts --- src/components/chart/statistics-chart.ts | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/components/chart/statistics-chart.ts b/src/components/chart/statistics-chart.ts index dd60599bc2..596eb92b7d 100644 --- a/src/components/chart/statistics-chart.ts +++ b/src/components/chart/statistics-chart.ts @@ -106,6 +106,8 @@ export class StatisticsChart extends LitElement { private _computedStyle?: CSSStyleDeclaration; + private _previousYAxisLabelValue = 0; + protected shouldUpdate(changedProps: PropertyValues): boolean { return changedProps.size > 1 || !changedProps.has("hass"); } @@ -314,6 +316,9 @@ export class StatisticsChart extends LitElement { splitLine: { show: true, }, + axisLabel: { + formatter: this._formatYAxisLabel, + } as any, }, legend: { type: "custom", @@ -640,6 +645,22 @@ export class StatisticsChart extends LitElement { return Math.abs(value) < 1 ? value : roundingFn(value); } + private _formatYAxisLabel = (value: number) => { + // show the first significant digit for tiny values + const maximumFractionDigits = Math.max( + 1, + // use the difference to the previous value to determine the number of significant digits #25526 + -Math.floor( + Math.log10(Math.abs(value - this._previousYAxisLabelValue || 1)) + ) + ); + const label = formatNumber(value, this.hass.locale, { + maximumFractionDigits, + }); + this._previousYAxisLabelValue = value; + return label; + }; + static styles = css` :host { display: block; From 361474885f008415438780ab86a61801e7de5373 Mon Sep 17 00:00:00 2001 From: Petar Petrov Date: Wed, 16 Jul 2025 11:00:49 +0300 Subject: [PATCH 4/6] Fix entity renaming when adding a new device (#26177) --- src/dialogs/config-flow/step-flow-create-entry.ts | 5 ++++- .../integrations/integration-panels/zha/zha-device-card.ts | 2 +- .../zwave_js/add-node/dialog-zwave_js-add-node.ts | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/dialogs/config-flow/step-flow-create-entry.ts b/src/dialogs/config-flow/step-flow-create-entry.ts index bfc0527511..4b9eae53a7 100644 --- a/src/dialogs/config-flow/step-flow-create-entry.ts +++ b/src/dialogs/config-flow/step-flow-create-entry.ts @@ -212,7 +212,10 @@ class StepFlowCreateEntry extends LitElement { entityIds.push(...entities.map((entity) => entity.entity_id)); }); - const entityIdsMapping = getAutomaticEntityIds(this.hass, entityIds); + const entityIdsMapping = await getAutomaticEntityIds( + this.hass, + entityIds + ); Object.entries(entityIdsMapping).forEach(([oldEntityId, newEntityId]) => { if (newEntityId) { diff --git a/src/panels/config/integrations/integration-panels/zha/zha-device-card.ts b/src/panels/config/integrations/integration-panels/zha/zha-device-card.ts index 4e0908e746..26068ca5bc 100644 --- a/src/panels/config/integrations/integration-panels/zha/zha-device-card.ts +++ b/src/panels/config/integrations/integration-panels/zha/zha-device-card.ts @@ -134,7 +134,7 @@ class ZHADeviceCard extends SubscribeMixin(LitElement) { } const entities = this._deviceEntities(device.device_reg_id, this._entities); - const entityIdsMapping = getAutomaticEntityIds( + const entityIdsMapping = await getAutomaticEntityIds( this.hass, entities.map((entity) => entity.entity_id) ); diff --git a/src/panels/config/integrations/integration-panels/zwave_js/add-node/dialog-zwave_js-add-node.ts b/src/panels/config/integrations/integration-panels/zwave_js/add-node/dialog-zwave_js-add-node.ts index 561cf10848..5b9bb819d8 100644 --- a/src/panels/config/integrations/integration-panels/zwave_js/add-node/dialog-zwave_js-add-node.ts +++ b/src/panels/config/integrations/integration-panels/zwave_js/add-node/dialog-zwave_js-add-node.ts @@ -878,7 +878,7 @@ class DialogZWaveJSAddNode extends SubscribeMixin(LitElement) { (entity) => entity.device_id === this._device!.id ); - const entityIdsMapping = getAutomaticEntityIds( + const entityIdsMapping = await getAutomaticEntityIds( this.hass, entities.map((entity) => entity.entity_id) ); From cf3c40f5f7e8c65301a0d955d159223125657465 Mon Sep 17 00:00:00 2001 From: Petar Petrov Date: Wed, 16 Jul 2025 18:29:28 +0300 Subject: [PATCH 5/6] Fix "Cancel exclusion" button for Z-Wave (#26188) --- .../integration-panels/zwave_js/dialog-zwave_js-remove-node.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/panels/config/integrations/integration-panels/zwave_js/dialog-zwave_js-remove-node.ts b/src/panels/config/integrations/integration-panels/zwave_js/dialog-zwave_js-remove-node.ts index 58e88b3c00..2bbb6d13fe 100644 --- a/src/panels/config/integrations/integration-panels/zwave_js/dialog-zwave_js-remove-node.ts +++ b/src/panels/config/integrations/integration-panels/zwave_js/dialog-zwave_js-remove-node.ts @@ -323,7 +323,7 @@ class DialogZWaveJSRemoveNode extends LitElement { this._subscribed.then((unsub) => unsub && unsub()); this._subscribed = undefined; } - if (this._step === "exclusion") { + if (this._step === "exclusion" && this._entryId) { this._stopExclusion(); } if (this._removeNodeTimeoutHandle) { @@ -332,6 +332,7 @@ class DialogZWaveJSRemoveNode extends LitElement { }; public closeDialog(): void { + this._unsubscribe(); this._entryId = undefined; } From fa968f49c140b4537163558606eac8f61a528a81 Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Fri, 18 Jul 2025 10:32:06 +0200 Subject: [PATCH 6/6] Bumped version to 20250702.3 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index d5ef09e5da..e4ef973631 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "home-assistant-frontend" -version = "20250702.2" +version = "20250702.3" license = "Apache-2.0" license-files = ["LICENSE*"] description = "The Home Assistant frontend"