From 9f17f6a8cf0be615fd9733da5771d7d85dafe635 Mon Sep 17 00:00:00 2001 From: Jan Rieger Date: Wed, 25 Sep 2024 20:02:34 +0200 Subject: [PATCH 01/15] Fix typo (#22086) --- cast/src/html/faq.html.template | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cast/src/html/faq.html.template b/cast/src/html/faq.html.template index ba22de7284..983c83e6ed 100644 --- a/cast/src/html/faq.html.template +++ b/cast/src/html/faq.html.template @@ -139,7 +139,7 @@

-
Wat does Home Assistant Cast do?
+
What does Home Assistant Cast do?

Home Assistant Cast is a receiver application for the Chromecast. When From f70ce7491ae84840a66a8cd16649eebd33ea12ca Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 26 Sep 2024 09:48:41 +0200 Subject: [PATCH 02/15] Update dependency @rollup/plugin-node-resolve to v15.2.4 (#22092) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 13 ++++++------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index 7e1191ed92..9f8b3cf1c6 100644 --- a/package.json +++ b/package.json @@ -167,7 +167,7 @@ "@rollup/plugin-babel": "6.0.4", "@rollup/plugin-commonjs": "26.0.1", "@rollup/plugin-json": "6.1.0", - "@rollup/plugin-node-resolve": "15.2.3", + "@rollup/plugin-node-resolve": "15.2.4", "@rollup/plugin-replace": "5.0.7", "@types/babel__plugin-transform-runtime": "7.9.5", "@types/chromecast-caf-receiver": "6.0.17", diff --git a/yarn.lock b/yarn.lock index 785fcee0c2..e38cfcf1f6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3793,14 +3793,13 @@ __metadata: languageName: node linkType: hard -"@rollup/plugin-node-resolve@npm:15.2.3, @rollup/plugin-node-resolve@npm:^15.2.3": - version: 15.2.3 - resolution: "@rollup/plugin-node-resolve@npm:15.2.3" +"@rollup/plugin-node-resolve@npm:15.2.4, @rollup/plugin-node-resolve@npm:^15.2.3": + version: 15.2.4 + resolution: "@rollup/plugin-node-resolve@npm:15.2.4" dependencies: "@rollup/pluginutils": "npm:^5.0.1" "@types/resolve": "npm:1.20.2" deepmerge: "npm:^4.2.2" - is-builtin-module: "npm:^3.2.1" is-module: "npm:^1.0.0" resolve: "npm:^1.22.1" peerDependencies: @@ -3808,7 +3807,7 @@ __metadata: peerDependenciesMeta: rollup: optional: true - checksum: 10/d36a6792fbe9d8673d3a7c7dc88920be669ac54fba02ac0093d3c00fc9463fce2e87da1906a2651016742709c3d202b367fb49a62acd0d98f18409343f27b8b4 + checksum: 10/ad1940019344df457be88414393214fa69eaabba59cb7763bd81a9baacf0bb80efedf1bb999c40593860974b905f8d96ea8600b3b04f402f04da9c7ddc714178 languageName: node linkType: hard @@ -8973,7 +8972,7 @@ __metadata: "@rollup/plugin-babel": "npm:6.0.4" "@rollup/plugin-commonjs": "npm:26.0.1" "@rollup/plugin-json": "npm:6.1.0" - "@rollup/plugin-node-resolve": "npm:15.2.3" + "@rollup/plugin-node-resolve": "npm:15.2.4" "@rollup/plugin-replace": "npm:5.0.7" "@thomasloven/round-slider": "npm:0.6.0" "@types/babel__plugin-transform-runtime": "npm:7.9.5" @@ -9597,7 +9596,7 @@ __metadata: languageName: node linkType: hard -"is-builtin-module@npm:^3.0.0, is-builtin-module@npm:^3.1.0, is-builtin-module@npm:^3.2.1": +"is-builtin-module@npm:^3.0.0, is-builtin-module@npm:^3.1.0": version: 3.2.1 resolution: "is-builtin-module@npm:3.2.1" dependencies: From 27bdf801687f8c76cd09320dcd5e976af8d2e194 Mon Sep 17 00:00:00 2001 From: Paul Bottein Date: Thu, 26 Sep 2024 09:59:48 +0200 Subject: [PATCH 03/15] Fix automation drag and drop (#22093) --- src/panels/config/automation/manual-automation-editor.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/panels/config/automation/manual-automation-editor.ts b/src/panels/config/automation/manual-automation-editor.ts index 6c81607fe1..23855571d1 100644 --- a/src/panels/config/automation/manual-automation-editor.ts +++ b/src/panels/config/automation/manual-automation-editor.ts @@ -90,7 +90,7 @@ export class HaManualAutomationEditor extends LitElement { role="region" aria-labelledby="triggers-heading" .triggers=${this.config.triggers || []} - .path=${["trigger"]} + .path=${["triggers"]} @value-changed=${this._triggerChanged} @item-moved=${this._itemMoved} .hass=${this.hass} @@ -132,7 +132,7 @@ export class HaManualAutomationEditor extends LitElement { role="region" aria-labelledby="conditions-heading" .conditions=${this.config.conditions || []} - .path=${["condition"]} + .path=${["conditions"]} @value-changed=${this._conditionChanged} @item-moved=${this._itemMoved} .hass=${this.hass} @@ -172,7 +172,7 @@ export class HaManualAutomationEditor extends LitElement { role="region" aria-labelledby="actions-heading" .actions=${this.config.actions || []} - .path=${["action"]} + .path=${["actions"]} @value-changed=${this._actionChanged} @item-moved=${this._itemMoved} .hass=${this.hass} From dd179e1f4e21971854074d2d64a12e60e4833504 Mon Sep 17 00:00:00 2001 From: Wendelin <12148533+wendevlin@users.noreply.github.com> Date: Thu, 26 Sep 2024 12:12:10 +0200 Subject: [PATCH 04/15] Add seperator to dialog-repairs-issue-subtitle (#22095) --- src/panels/config/repairs/dialog-repairs-issue-subtitle.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/panels/config/repairs/dialog-repairs-issue-subtitle.ts b/src/panels/config/repairs/dialog-repairs-issue-subtitle.ts index 3a09766df8..6ea15ed6e4 100644 --- a/src/panels/config/repairs/dialog-repairs-issue-subtitle.ts +++ b/src/panels/config/repairs/dialog-repairs-issue-subtitle.ts @@ -20,9 +20,9 @@ class DialogRepairsIssueSubtitle extends LitElement { protected render() { const domainName = domainToName(this.hass.localize, this.issue.domain); const reportedBy = domainName - ? this.hass.localize("ui.panel.config.repairs.reported_by", { + ? ` βΈ± ${this.hass.localize("ui.panel.config.repairs.reported_by", { integration: domainName, - }) + })}` : ""; const severity = this.hass.localize( From 5a5005c09cf16321222d5a3342d7a4ece11d05bc Mon Sep 17 00:00:00 2001 From: Wendelin <12148533+wendevlin@users.noreply.github.com> Date: Thu, 26 Sep 2024 12:15:03 +0200 Subject: [PATCH 05/15] Fix matter commissioning wording and add prevent misuse alert (#22083) * Fix matter commissioning wording and add prevent misuse alert * Update src/translations/en.json Co-authored-by: Bram Kragten * Add small misuese prevent note for matter-commissioning dialog --------- Co-authored-by: Paul Bottein Co-authored-by: Bram Kragten --- ...dialog-matter-open-commissioning-window.ts | 19 ++++++++++++++++++- src/translations/en.json | 3 ++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/src/panels/config/integrations/integration-panels/matter/dialog-matter-open-commissioning-window.ts b/src/panels/config/integrations/integration-panels/matter/dialog-matter-open-commissioning-window.ts index ec3d5ff3a0..a346f4a3c6 100644 --- a/src/panels/config/integrations/integration-panels/matter/dialog-matter-open-commissioning-window.ts +++ b/src/panels/config/integrations/integration-panels/matter/dialog-matter-open-commissioning-window.ts @@ -137,7 +137,19 @@ class DialogMatterOpenCommissioningWindow extends LitElement { : html`

${this.hass.localize( - "ui.panel.config.matter.open_commissioning_window.introduction" + "ui.panel.config.matter.open_commissioning_window.description", + { + startCommissioning: html`${this.hass.localize( + "ui.panel.config.matter.open_commissioning_window.start_commissioning" + )}`, + } + )} +

+

+ ${this.hass.localize( + "ui.panel.config.matter.open_commissioning_window.prevent_misuse_description" )}

@@ -247,6 +259,11 @@ class DialogMatterOpenCommissioningWindow extends LitElement { .code { font-family: monospace; } + + .note { + color: var(--secondary-text-color); + font-size: 0.9em; + } `, ]; } diff --git a/src/translations/en.json b/src/translations/en.json index c6002da58b..c547b9fe5b 100644 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -5131,7 +5131,8 @@ }, "open_commissioning_window": { "title": "Share device", - "introduction": "Enable commissioning mode on the device to pair it to another Matter controller.", + "description": "To continue, select {startCommissioning}. Home Assistant will then put your device in commissioning mode, allowing it to pair with another Matter controller.", + "prevent_misuse_description": "Note: Do not press the physical setup button on the device as this will reset it.", "start_commissioning": "Share device", "in_progress": "We're communicating with the device. This may take some time.", "failed": "The command failed. Additional information may be available in the logs.", From 62cba99491a05b5d3a77015d57afb2f83f59feee Mon Sep 17 00:00:00 2001 From: Paul Bottein Date: Thu, 26 Sep 2024 12:15:58 +0200 Subject: [PATCH 06/15] Don't use ha-card in card-condition-editor (#22085) --- .../conditions/ha-card-condition-editor.ts | 240 +++++++++--------- 1 file changed, 114 insertions(+), 126 deletions(-) diff --git a/src/panels/lovelace/editor/conditions/ha-card-condition-editor.ts b/src/panels/lovelace/editor/conditions/ha-card-condition-editor.ts index 5ab2ee2613..d7d41c1dea 100644 --- a/src/panels/lovelace/editor/conditions/ha-card-condition-editor.ts +++ b/src/panels/lovelace/editor/conditions/ha-card-condition-editor.ts @@ -93,134 +93,120 @@ export class HaCardConditionEditor extends LitElement { if (!condition) return nothing; return html` - +

- ${ - this.hass.localize( - `ui.panel.lovelace.editor.condition-editor.condition.${condition.condition}.label` - ) || condition.condition - } + ${this.hass.localize( + `ui.panel.lovelace.editor.condition-editor.condition.${condition.condition}.label` + ) || condition.condition}

- + - - + - - ${this.hass.localize( - "ui.panel.lovelace.editor.condition-editor.test" - )} - - + + ${this.hass.localize( + "ui.panel.lovelace.editor.condition-editor.test" + )} + + - - ${this.hass.localize( - "ui.panel.lovelace.editor.edit_card.edit_ui" - )} - ${ - !this._yamlMode - ? html` - - ` - : `` - } - - - - ${this.hass.localize( - "ui.panel.lovelace.editor.edit_card.edit_yaml" - )} - ${ - this._yamlMode - ? html` - - ` - : `` - } - - -
  • - - - ${this.hass!.localize("ui.common.delete")} - - -
    -
    - ${ - !this._uiAvailable - ? html` - - ${this._uiWarnings!.length > 0 && - this._uiWarnings![0] !== undefined - ? html` -
      - ${this._uiWarnings!.map( - (warning) => html`
    • ${warning}
    • ` - )} -
    - ` - : nothing} - ${this.hass.localize( - "ui.errors.config.edit_in_yaml_supported" - )} -
    - ` - : nothing - } -
    - ${ - this._yamlMode + + ${this.hass.localize( + "ui.panel.lovelace.editor.edit_card.edit_ui" + )} + ${!this._yamlMode ? html` - + ` - : html` - ${dynamicElement( - `ha-card-condition-${condition.condition}`, - { - hass: this.hass, - condition: condition, - } - )} + : ``} + + + + ${this.hass.localize( + "ui.panel.lovelace.editor.edit_card.edit_yaml" + )} + ${this._yamlMode + ? html` + ` - } + : ``} + + +
  • + + + ${this.hass!.localize("ui.common.delete")} + + + + ${!this._uiAvailable + ? html` + + ${this._uiWarnings!.length > 0 && + this._uiWarnings![0] !== undefined + ? html` +
      + ${this._uiWarnings!.map( + (warning) => html`
    • ${warning}
    • ` + )} +
    + ` + : nothing} + ${this.hass.localize( + "ui.errors.config.edit_in_yaml_supported" + )} +
    + ` + : nothing} +
    + ${this._yamlMode + ? html` + + ` + : html` + ${dynamicElement(`ha-card-condition-${condition.condition}`, { + hass: this.hass, + condition: condition, + })} + `}
    - ${ - this._testingResult + ${this._testingResult + ? this.hass.localize( + "ui.panel.lovelace.editor.condition-editor.testing_pass" + ) + : this._testingResult === false ? this.hass.localize( - "ui.panel.lovelace.editor.condition-editor.testing_pass" + "ui.panel.lovelace.editor.condition-editor.testing_error" ) - : this._testingResult === false - ? this.hass.localize( - "ui.panel.lovelace.editor.condition-editor.testing_error" - ) - : nothing - } + : nothing}
    - +
    `; } @@ -313,7 +297,6 @@ export class HaCardConditionEditor extends LitElement { ha-button-menu { --mdc-theme-text-primary-on-background: var(--primary-text-color); } - ha-expansion-panel { --expansion-panel-summary-padding: 0 0 0 8px; --expansion-panel-content-padding: 0; @@ -372,6 +355,11 @@ export class HaCardConditionEditor extends LitElement { .testing.pass { background-color: var(--success-color); } + .container { + position: relative; + border-radius: var(--ha-card-border-radius, 12px); + border: 1px solid var(--divider-color); + } `, ]; } From ff9af2f98086eb1754ce3bc8e343bcb7ee2d31e4 Mon Sep 17 00:00:00 2001 From: Wendelin <12148533+wendevlin@users.noreply.github.com> Date: Thu, 26 Sep 2024 14:11:34 +0200 Subject: [PATCH 07/15] Fix delete appearance chip (#22098) * Add filter option to ha-sortable * Filter chips remove buttons from dragging in ha-entity-state-content-picker --- .../entity/ha-entity-state-content-picker.ts | 1 + src/components/ha-sortable.ts | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/src/components/entity/ha-entity-state-content-picker.ts b/src/components/entity/ha-entity-state-content-picker.ts index bdc75c9c3a..f80df1679f 100644 --- a/src/components/entity/ha-entity-state-content-picker.ts +++ b/src/components/entity/ha-entity-state-content-picker.ts @@ -173,6 +173,7 @@ class HaEntityStatePicker extends LitElement { no-style @item-moved=${this._moveItem} .disabled=${this.disabled} + filter="button.trailing.action" > ${repeat( diff --git a/src/components/ha-sortable.ts b/src/components/ha-sortable.ts index e86c32dd77..8d784445ad 100644 --- a/src/components/ha-sortable.ts +++ b/src/components/ha-sortable.ts @@ -43,6 +43,13 @@ export class HaSortable extends LitElement { @property({ type: String, attribute: "handle-selector" }) public handleSelector?: string; + /** + * Selectors that do not lead to dragging (String or Function) + * https://github.com/SortableJS/Sortable?tab=readme-ov-file#filter-option + * */ + @property({ type: String, attribute: "filter" }) + public filter?: string; + @property({ type: String }) public group?: string | SortableInstance.GroupOptions; @@ -145,6 +152,9 @@ export class HaSortable extends LitElement { if (this.group) { options.group = this.group; } + if (this.filter) { + options.filter = this.filter; + } this._sortable = new Sortable(container, options); } From 3fbd5f07a92900febb09db65c0c079f15465d146 Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Thu, 26 Sep 2024 14:17:28 +0200 Subject: [PATCH 08/15] Fix dialog box callback order (#22097) * Fix dialog box callback order * Update dialog-box.ts --- src/dialogs/generic/dialog-box.ts | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/dialogs/generic/dialog-box.ts b/src/dialogs/generic/dialog-box.ts index 0bff1f20ca..4d1ebc1c66 100644 --- a/src/dialogs/generic/dialog-box.ts +++ b/src/dialogs/generic/dialog-box.ts @@ -129,32 +129,31 @@ class DialogBox extends LitElement { } private _dismiss(): void { - this._cancel(); this._closeState = "canceled"; this._closeDialog(); + this._cancel(); } private _confirm(): void { + this._closeState = "confirmed"; + this._closeDialog(); if (this._params!.confirm) { this._params!.confirm(this._textField?.value); } - this._closeState = "confirmed"; - this._closeDialog(); } private _closeDialog() { + fireEvent(this, "dialog-closed", { dialog: this.localName }); this._dialog?.close(); } private _dialogClosed() { if (!this._closeState) { + fireEvent(this, "dialog-closed", { dialog: this.localName }); this._cancel(); } - if (!this._params) { - return; - } + this._closeState = undefined; this._params = undefined; - fireEvent(this, "dialog-closed", { dialog: this.localName }); } static get styles(): CSSResultGroup { From fc8945be60fe00ca1820a8aa70ceb83a7ac8342a Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Thu, 26 Sep 2024 14:31:53 +0200 Subject: [PATCH 09/15] Flatten fields in sections in developer tools actions (#22096) * flatten fields in sections in developer tools actions * Update src/panels/developer-tools/action/developer-tools-action.ts --------- Co-authored-by: Paul Bottein --- .../action/developer-tools-action.ts | 32 +++++++++++++------ 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/src/panels/developer-tools/action/developer-tools-action.ts b/src/panels/developer-tools/action/developer-tools-action.ts index 40c8876501..f0f6dc78b1 100644 --- a/src/panels/developer-tools/action/developer-tools-action.ts +++ b/src/panels/developer-tools/action/developer-tools-action.ts @@ -1,5 +1,5 @@ import { mdiHelpCircle } from "@mdi/js"; -import { ERR_CONNECTION_LOST } from "home-assistant-js-websocket"; +import { ERR_CONNECTION_LOST, HassService } from "home-assistant-js-websocket"; import { load } from "js-yaml"; import { css, CSSResultGroup, html, LitElement, nothing } from "lit"; import { customElement, property, query, state } from "lit/decorators"; @@ -8,16 +8,16 @@ import { storage } from "../../../common/decorators/storage"; import { computeDomain } from "../../../common/entity/compute_domain"; import { computeObjectId } from "../../../common/entity/compute_object_id"; import { hasTemplate } from "../../../common/string/has-template"; -import { extractSearchParam } from "../../../common/url/search-params"; -import { HaProgressButton } from "../../../components/buttons/ha-progress-button"; import { LocalizeFunc } from "../../../common/translations/localize"; -import { showToast } from "../../../util/toast"; +import { extractSearchParam } from "../../../common/url/search-params"; import { copyToClipboard } from "../../../common/util/copy-clipboard"; +import { HaProgressButton } from "../../../components/buttons/ha-progress-button"; +import { showToast } from "../../../util/toast"; import "../../../components/entity/ha-entity-picker"; -import "../../../components/ha-card"; import "../../../components/ha-alert"; import "../../../components/ha-button"; +import "../../../components/ha-card"; import "../../../components/ha-expansion-panel"; import "../../../components/ha-icon-button"; import "../../../components/ha-service-control"; @@ -382,10 +382,24 @@ class HaPanelDevAction extends LitElement { } const target = "target" in serviceDomains[domain][service]; const fields = serviceDomains[domain][service].fields; - const result = Object.keys(fields).map((field) => ({ - key: field, - ...fields[field], - })); + const result: (HassService["fields"] & { key: string })[] = []; + + // TODO: remplace any by proper type when updated in home-assistant-js-websocket + const getFields = (flds: any) => { + Object.keys(flds).forEach((field) => { + const fieldData = flds[field]; + if (fieldData.fields) { + getFields(fieldData.fields); + } else { + result.push({ + key: field, + ...fieldData, + }); + } + }); + }; + + getFields(fields); return { target, From deece2020645d53823d4803aceeb6a10d2f0b950 Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Thu, 26 Sep 2024 16:46:15 +0200 Subject: [PATCH 10/15] Include extended_pan_id when commissioning matter (#22099) --- src/data/matter.ts | 1 + src/external_app/external_messaging.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/src/data/matter.ts b/src/data/matter.ts index 3872d81c51..10534f181a 100644 --- a/src/data/matter.ts +++ b/src/data/matter.ts @@ -68,6 +68,7 @@ export const startExternalCommissioning = async (hass: HomeAssistant) => { ).tlv, border_agent_id: preferredDataset.preferred_border_agent_id, mac_extended_address: preferredDataset.preferred_extended_address, + extended_pan_id: preferredDataset.extended_pan_id, }, }); } diff --git a/src/external_app/external_messaging.ts b/src/external_app/external_messaging.ts index 5e18414583..e8a436e203 100644 --- a/src/external_app/external_messaging.ts +++ b/src/external_app/external_messaging.ts @@ -59,6 +59,7 @@ interface EMOutgoingMessageMatterCommission extends EMMessage { type: "matter/commission"; payload?: { mac_extended_address: string | null; + extended_pan_id: string | null; border_agent_id: string | null; active_operational_dataset: string | null; }; From 500bc959f006a8d5427a2caf4a7a4fd5bd13759e Mon Sep 17 00:00:00 2001 From: Erik Montnemery Date: Thu, 26 Sep 2024 16:46:35 +0200 Subject: [PATCH 11/15] Improve translation strings for statistic issues (#22100) --- src/translations/en.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/translations/en.json b/src/translations/en.json index c547b9fe5b..b380e31eee 100644 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -6979,7 +6979,7 @@ }, "unsupported_state_class": { "title": "Unsupported state class", - "info_text_1": "The state class of {name}, {state_class} is not supported.", + "info_text_1": "The state class of {name}, ''{state_class}'', is not supported.", "info_text_2": "Statistics cannot be generated until this entity has a supported state class.", "info_text_3": "If this state class was provided by an integration, this is a bug. Please report an issue.", "info_text_4": "If you have set this state class yourself, please correct it.", @@ -6988,7 +6988,7 @@ "info_text_6": "Do you want to permanently delete the long term statistics of {statistic_id} from your database?" }, "units_changed": { - "title": "The unit changed", + "title": "The unit has changed", "update": "Update the unit of the historic statistic values from ''{metadata_unit}'' to ''{state_unit}'', without converting.", "clear": "Delete all old statistic data for this entity", "how_to_fix": "How do you want to fix this issue?", From 59945cb2f8b72f6acb5517484d20006440cb740f Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Thu, 26 Sep 2024 18:07:54 +0200 Subject: [PATCH 12/15] Add statistic id to statistic issue fix messages (#22104) * Add statistic id to fix messages * revert state class check, as it will be solved in another way --- .../statistics/dialog-statistics-fix-units-changed.ts | 1 + .../developer-tools/statistics/fix-statistics.ts | 3 +++ src/translations/en.json | 10 +++++----- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/panels/developer-tools/statistics/dialog-statistics-fix-units-changed.ts b/src/panels/developer-tools/statistics/dialog-statistics-fix-units-changed.ts index e2bb707208..15263541db 100644 --- a/src/panels/developer-tools/statistics/dialog-statistics-fix-units-changed.ts +++ b/src/panels/developer-tools/statistics/dialog-statistics-fix-units-changed.ts @@ -61,6 +61,7 @@ export class DialogStatisticsFixUnitsChanged extends LitElement { this._params.issue.data.statistic_id, undefined ), + statistic_id: this._params.issue.data.statistic_id, current_unit: this._params.issue.data.state_unit, previous_unit: this._params.issue.data.metadata_unit, } diff --git a/src/panels/developer-tools/statistics/fix-statistics.ts b/src/panels/developer-tools/statistics/fix-statistics.ts index 6b2d6a7aff..8dd140e718 100644 --- a/src/panels/developer-tools/statistics/fix-statistics.ts +++ b/src/panels/developer-tools/statistics/fix-statistics.ts @@ -29,6 +29,7 @@ export const fixStatisticsIssue = async ( "ui.panel.developer-tools.tabs.statistics.fix_issue.no_state.info_text_1", { name: getStatisticLabel(hass, issue.data.statistic_id, undefined), + statistic_id: issue.data.statistic_id, } )}

    ${localize( "ui.panel.developer-tools.tabs.statistics.fix_issue.no_state.info_text_2", @@ -75,6 +76,7 @@ export const fixStatisticsIssue = async ( "ui.panel.developer-tools.tabs.statistics.fix_issue.entity_no_longer_recorded.info_text_1", { name: getStatisticLabel(hass, issue.data.statistic_id, undefined), + statistic_id: issue.data.statistic_id, } )} ${localize( @@ -110,6 +112,7 @@ export const fixStatisticsIssue = async ( "ui.panel.developer-tools.tabs.statistics.fix_issue.unsupported_state_class.info_text_1", { name: getStatisticLabel(hass, issue.data.statistic_id, undefined), + statistic_id: issue.data.statistic_id, state_class: issue.data.state_class, } )}

    diff --git a/src/translations/en.json b/src/translations/en.json index b380e31eee..a98734fc3e 100644 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -6961,25 +6961,25 @@ }, "no_state": { "title": "Entity has no state", - "info_text_1": "{name} has no state at the moment, if this is an orphaned entity, you may want to delete the long term statistics of it from your database.", + "info_text_1": "''{name}'' ({statistic_id}) has no state at the moment, if this is an orphaned entity, you may want to delete the long term statistics of it from your database.", "info_text_2": "Do you want to permanently delete the long term statistics of {statistic_id} from your database?" }, "entity_not_recorded": { "title": "Entity is not recorded", - "info_text_1": "State changes of {name} are not recorded, therefore, we cannot track long term statistics for it.", + "info_text_1": "State changes of ''{name}'' ({statistic_id}) are not recorded, therefore, we cannot track long term statistics for it.", "info_text_2": "You probably excluded this entity, or have just included some entities.", "info_text_3_link": "See the recorder documentation for more information." }, "entity_no_longer_recorded": { "title": "Entity is no longer recorded", - "info_text_1": "We have generated statistics for {name} in the past, but state changes of this entity are no longer recorded, therefore, we cannot track long term statistics for it anymore.", + "info_text_1": "We have generated statistics for ''{name}'' ({statistic_id}) in the past, but state changes of this entity are no longer recorded, therefore, we cannot track long term statistics for it anymore.", "info_text_2": "You probably excluded this entity, or have just included some entities.", "info_text_3_link": "See the recorder documentation for more information.", "info_text_4": "If you no longer wish to keep the long term statistics recorded in the past, you may delete them now." }, "unsupported_state_class": { "title": "Unsupported state class", - "info_text_1": "The state class of {name}, ''{state_class}'', is not supported.", + "info_text_1": "The state class of ''{name}'' ({statistic_id}), ''{state_class}'', is not supported.", "info_text_2": "Statistics cannot be generated until this entity has a supported state class.", "info_text_3": "If this state class was provided by an integration, this is a bug. Please report an issue.", "info_text_4": "If you have set this state class yourself, please correct it.", @@ -6992,7 +6992,7 @@ "update": "Update the unit of the historic statistic values from ''{metadata_unit}'' to ''{state_unit}'', without converting.", "clear": "Delete all old statistic data for this entity", "how_to_fix": "How do you want to fix this issue?", - "info_text_1": "The unit of {name} changed to ''{current_unit}'' which can't be converted to the previously stored unit, ''{previous_unit}''.", + "info_text_1": "The unit of ''{name}'' ({statistic_id}) changed to ''{current_unit}'' which can't be converted to the previously stored unit, ''{previous_unit}''.", "info_text_2": "If the historic statistic values have a wrong unit, you can update the units of the old values. The values will not be updated.", "info_text_3": "Otherwise you can choose to delete all historic statistic values, and start over." }, From 5551e98388abc462cdefb7b98d35d3e919e742c7 Mon Sep 17 00:00:00 2001 From: Wendelin <12148533+wendevlin@users.noreply.github.com> Date: Thu, 26 Sep 2024 18:22:28 +0200 Subject: [PATCH 13/15] Add no IP found message to ping a matter device (#22103) --- .../matter/dialog-matter-ping-node.ts | 101 ++++++++++-------- src/translations/en.json | 3 +- 2 files changed, 58 insertions(+), 46 deletions(-) diff --git a/src/panels/config/integrations/integration-panels/matter/dialog-matter-ping-node.ts b/src/panels/config/integrations/integration-panels/matter/dialog-matter-ping-node.ts index cbe8dc544f..7eac7b39d1 100644 --- a/src/panels/config/integrations/integration-panels/matter/dialog-matter-ping-node.ts +++ b/src/panels/config/integrations/integration-panels/matter/dialog-matter-ping-node.ts @@ -5,7 +5,7 @@ import { customElement, property, state } from "lit/decorators"; import { fireEvent } from "../../../../../common/dom/fire_event"; import "../../../../../components/ha-circular-progress"; import { createCloseHeading } from "../../../../../components/ha-dialog"; -import { pingMatterNode, MatterPingResult } from "../../../../../data/matter"; +import { pingMatterNode } from "../../../../../data/matter"; import { haStyle, haStyleDialog } from "../../../../../resources/styles"; import { HomeAssistant } from "../../../../../types"; import { MatterPingNodeDialogParams } from "./show-dialog-matter-ping-node"; @@ -16,9 +16,12 @@ class DialogMatterPingNode extends LitElement { @state() private device_id?: string; - @state() private _status?: string; + @state() private _status?: "started" | "failed"; - @state() private _pingResult?: MatterPingResult; + @state() private _pingResultEntries?: [ + ip_address: string, + success: boolean, + ][]; public async showDialog(params: MatterPingNodeDialogParams): Promise { this.device_id = params.device_id; @@ -38,60 +41,62 @@ class DialogMatterPingNode extends LitElement { this.hass.localize("ui.panel.config.matter.ping_node.title") )} > - ${this._pingResult + ${this._status === "failed" ? html` -

    - ${this.hass.localize( - "ui.panel.config.matter.ping_node.ping_complete" - )} -

    - - ${Object.entries(this._pingResult).map( - ([ip, success]) => - html`${ip} - - ` - )} - +
    + +
    +

    + ${this.hass.localize( + this._pingResultEntries + ? "ui.panel.config.matter.ping_node.no_ip_found" + : "ui.panel.config.matter.ping_node.ping_failed" + )} +

    +
    +
    ${this.hass.localize("ui.common.close")} ` - : this._status === "started" + : this._pingResultEntries ? html` -
    - -
    -

    - - ${this.hass.localize( - "ui.panel.config.matter.ping_node.in_progress" - )} - -

    -
    -
    +

    + ${this.hass.localize( + "ui.panel.config.matter.ping_node.ping_complete" + )} +

    + + ${this._pingResultEntries.map( + ([ip, success]) => + html`${ip} + + ` + )} + ${this.hass.localize("ui.common.close")} ` - : this._status === "failed" + : this._status === "started" ? html`
    - +

    - ${this.hass.localize( - "ui.panel.config.matter.ping_node.ping_failed" - )} + + ${this.hass.localize( + "ui.panel.config.matter.ping_node.in_progress" + )} +

    @@ -128,7 +133,13 @@ class DialogMatterPingNode extends LitElement { } this._status = "started"; try { - this._pingResult = await pingMatterNode(this.hass, this.device_id!); + const pingResult = await pingMatterNode(this.hass, this.device_id!); + const pingResultEntries = Object.entries(pingResult); + if (pingResultEntries.length === 0) { + this._status = "failed"; + } + + this._pingResultEntries = pingResultEntries; } catch (err) { this._status = "failed"; } @@ -137,7 +148,7 @@ class DialogMatterPingNode extends LitElement { public closeDialog(): void { this.device_id = undefined; this._status = undefined; - this._pingResult = undefined; + this._pingResultEntries = undefined; fireEvent(this, "dialog-closed", { dialog: this.localName }); } diff --git a/src/translations/en.json b/src/translations/en.json index a98734fc3e..20677c99f7 100644 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -5127,7 +5127,8 @@ "start_ping": "Start ping", "in_progress": "The device is being pinged. This may take some time.", "ping_failed": "The device ping failed. Additional information may be available in the logs.", - "ping_complete": "Ping device complete." + "ping_complete": "Ping device complete.", + "no_ip_found": "The device ping failed. No IP addresses found for this device." }, "open_commissioning_window": { "title": "Share device", From d334b1ca7bcbdc6b2edd25a8e287e5360b29d216 Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Thu, 26 Sep 2024 18:25:30 +0200 Subject: [PATCH 14/15] Update voice-assistant-setup-step-update.ts --- .../voice-assistant-setup-step-update.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/dialogs/voice-assistant-setup/voice-assistant-setup-step-update.ts b/src/dialogs/voice-assistant-setup/voice-assistant-setup-step-update.ts index 14add40019..9cff75a475 100644 --- a/src/dialogs/voice-assistant-setup/voice-assistant-setup-step-update.ts +++ b/src/dialogs/voice-assistant-setup/voice-assistant-setup-step-update.ts @@ -1,4 +1,4 @@ -import { css, html, LitElement, PropertyValues } from "lit"; +import { css, html, LitElement, nothing, PropertyValues } from "lit"; import { customElement, property } from "lit/decorators"; import { fireEvent } from "../../common/dom/fire_event"; import "../../components/ha-circular-progress"; @@ -45,7 +45,11 @@ export class HaVoiceAssistantSetupStepUpdate extends LitElement { } protected override render() { - const stateObj = this.hass.states[this.updateEntityId!]; + if (!this.updateEntityId || !(this.updateEntityId in this.hass.states)) { + return nothing; + } + + const stateObj = this.hass.states[this.updateEntityId]; const progressIsNumeric = typeof stateObj?.attributes.in_progress === "number"; From 5d71d4c0a17bcb5f88e9207d57e33959dde1992a Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Thu, 26 Sep 2024 18:26:20 +0200 Subject: [PATCH 15/15] Bumped version to 20240926.0 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 8fd0e8fa62..d984a8f3ee 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "home-assistant-frontend" -version = "20240925.0" +version = "20240926.0" license = {text = "Apache-2.0"} description = "The Home Assistant frontend" readme = "README.md"