From 0374330676121755e47c2735fa3f1667a0e1266d Mon Sep 17 00:00:00 2001 From: 930913 <3722064+930913@users.noreply.github.com> Date: Sat, 31 Dec 2022 20:38:21 +0000 Subject: [PATCH 1/9] Add helper text to select slider (#14884) * Add helper text to select slider * Make helper text conditional Only show if set. Co-authored-by: Bram Kragten * Lint changes Co-authored-by: Bram Kragten --- src/components/ha-form/ha-form-integer.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/components/ha-form/ha-form-integer.ts b/src/components/ha-form/ha-form-integer.ts index f09821e3d7..86de2d310c 100644 --- a/src/components/ha-form/ha-form-integer.ts +++ b/src/components/ha-form/ha-form-integer.ts @@ -67,6 +67,9 @@ export class HaFormInteger extends LitElement implements HaFormElement { @change=${this._valueChanged} > + ${this.helper + ? html`${this.helper}` + : ""} `; } From 86ea3082f7fab01979a814ccb87135dccfcad2f5 Mon Sep 17 00:00:00 2001 From: Paul Bottein Date: Mon, 2 Jan 2023 12:10:52 +0100 Subject: [PATCH 2/9] Add aliases editor for helpers (#14951) --- .../settings/entity-settings-helper-tab.ts | 8 ++- .../entities/entity-registry-basic-editor.ts | 57 +++++++++++++++++++ 2 files changed, 64 insertions(+), 1 deletion(-) diff --git a/src/panels/config/entities/editor-tabs/settings/entity-settings-helper-tab.ts b/src/panels/config/entities/editor-tabs/settings/entity-settings-helper-tab.ts index 0ad83b15df..59b6471cc4 100644 --- a/src/panels/config/entities/editor-tabs/settings/entity-settings-helper-tab.ts +++ b/src/panels/config/entities/editor-tabs/settings/entity-settings-helper-tab.ts @@ -57,7 +57,13 @@ export class EntityRegistrySettingsHelper extends LitElement { super.updated(changedProperties); if (changedProperties.has("entry")) { this._error = undefined; - this._item = undefined; + if ( + this.entry.unique_id !== + (changedProperties.get("entry") as ExtEntityRegistryEntry)?.unique_id + ) { + this._item = undefined; + } + this._getItem(); } } diff --git a/src/panels/config/entities/entity-registry-basic-editor.ts b/src/panels/config/entities/entity-registry-basic-editor.ts index 3d915e2db4..f984f7a771 100644 --- a/src/panels/config/entities/entity-registry-basic-editor.ts +++ b/src/panels/config/entities/entity-registry-basic-editor.ts @@ -1,7 +1,11 @@ import "@material/mwc-formfield/mwc-formfield"; +import "@material/mwc-list/mwc-list"; +import "@material/mwc-list/mwc-list-item"; +import { mdiPencil } from "@mdi/js"; import { UnsubscribeFunc } from "home-assistant-js-websocket"; import { css, html, LitElement, PropertyValues, TemplateResult } from "lit"; import { customElement, property, state } from "lit/decorators"; +import { fireEvent } from "../../../common/dom/fire_event"; import { computeDomain } from "../../../common/entity/compute_domain"; import "../../../components/ha-area-picker"; import "../../../components/ha-expansion-panel"; @@ -21,6 +25,7 @@ import { import { showAlertDialog } from "../../../dialogs/generic/show-dialog-box"; import { SubscribeMixin } from "../../../mixins/subscribe-mixin"; import type { HomeAssistant } from "../../../types"; +import { showEntityAliasesDialog } from "./entity-aliases/show-dialog-entity-aliases"; @customElement("ha-registry-basic-editor") export class HaEntityRegistryBasicEditor extends SubscribeMixin(LitElement) { @@ -44,6 +49,20 @@ export class HaEntityRegistryBasicEditor extends SubscribeMixin(LitElement) { @state() private _submitting = false; + private _openAliasesSettings() { + showEntityAliasesDialog(this, { + entity: this.entry!, + updateEntry: async (updates) => { + const result = await updateEntityRegistryEntry( + this.hass, + this.entry.entity_id, + updates + ); + fireEvent(this, "entity-entry-updated", result.entity_entry); + }, + }); + } + public async updateEntry(): Promise { this._submitting = true; const params: Partial = { @@ -247,6 +266,37 @@ export class HaEntityRegistryBasicEditor extends SubscribeMixin(LitElement) { ` : ""} + +
+ ${this.hass.localize( + "ui.dialogs.entity_registry.editor.aliases_section" + )} +
+ + 0} + hasMeta + @click=${this._openAliasesSettings} + > + + ${this.entry.aliases.length > 0 + ? this.hass.localize( + "ui.dialogs.entity_registry.editor.configured_aliases", + { count: this.entry.aliases.length } + ) + : this.hass.localize( + "ui.dialogs.entity_registry.editor.no_aliases" + )} + + ${this.entry.aliases.join(", ")} + + + +
+ ${this.hass.localize( + "ui.dialogs.entity_registry.editor.aliases.description" + )} +
`; } @@ -300,6 +350,13 @@ export class HaEntityRegistryBasicEditor extends SubscribeMixin(LitElement) { .label { margin-top: 16px; } + .aliases { + border-radius: 4px; + margin-top: 4px; + margin-bottom: 4px; + --mdc-icon-button-size: 24px; + overflow: hidden; + } `; } } From bdef9244269853485856434ac2b9700ff27670d9 Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Mon, 2 Jan 2023 18:50:12 +0100 Subject: [PATCH 3/9] Enable unit conversion for DATA_RATE (#14902) Co-authored-by: Bram Kragten --- .../config/entities/entity-registry-settings.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/panels/config/entities/entity-registry-settings.ts b/src/panels/config/entities/entity-registry-settings.ts index 72f80712fe..177f9bfc15 100644 --- a/src/panels/config/entities/entity-registry-settings.ts +++ b/src/panels/config/entities/entity-registry-settings.ts @@ -119,6 +119,19 @@ const OVERRIDE_NUMBER_UNITS = { const OVERRIDE_SENSOR_UNITS = { current: ["A", "mA"], + data_rate: [ + "bit/s", + "kbit/s", + "Mbit/s", + "Gbit/s", + "B/s", + "kB/s", + "MB/s", + "GB/s", + "KiB/s", + "MiB/s", + "GiB/s", + ], distance: ["cm", "ft", "in", "km", "m", "mi", "mm", "yd"], gas: ["CCF", "ft³", "m³"], precipitation: ["cm", "in", "mm"], From fe874663515405df13681508aee9c44b067ad6f0 Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Mon, 2 Jan 2023 20:42:31 +0100 Subject: [PATCH 4/9] Add link to aliases in cloud config entity settings (#14959) --- demo/src/ha-demo.ts | 2 - gallery/src/pages/misc/integration-card.ts | 1 - src/components/entity/state-info.ts | 2 +- src/data/entity_registry.ts | 2 +- .../config/automation/ha-automation-trace.ts | 5 -- src/panels/config/cloud/alexa/cloud-alexa.ts | 64 ++++++++++------- .../cloud-google-assistant.ts | 71 ++++++++++++------- .../show-dialog-entity-aliases.ts | 4 +- .../config/entities/ha-config-entities.ts | 1 - src/panels/config/script/ha-script-trace.ts | 5 -- src/translations/en.json | 4 +- 11 files changed, 92 insertions(+), 69 deletions(-) diff --git a/demo/src/ha-demo.ts b/demo/src/ha-demo.ts index 37a707952a..070fea8b44 100644 --- a/demo/src/ha-demo.ts +++ b/demo/src/ha-demo.ts @@ -71,7 +71,6 @@ class HaDemo extends HomeAssistantAppEl { entity_category: null, has_entity_name: false, unique_id: "co2_intensity", - aliases: [], }, { config_entry_id: "co2signal", @@ -87,7 +86,6 @@ class HaDemo extends HomeAssistantAppEl { entity_category: null, has_entity_name: false, unique_id: "grid_fossil_fuel_percentage", - aliases: [], }, ]); diff --git a/gallery/src/pages/misc/integration-card.ts b/gallery/src/pages/misc/integration-card.ts index 8bd6acf6c8..56de4308e8 100644 --- a/gallery/src/pages/misc/integration-card.ts +++ b/gallery/src/pages/misc/integration-card.ts @@ -197,7 +197,6 @@ const createEntityRegistryEntries = ( platform: "updater", has_entity_name: false, unique_id: "updater", - aliases: [], }, ]; diff --git a/src/components/entity/state-info.ts b/src/components/entity/state-info.ts index 7ee6c6ba39..9db1bae9f7 100644 --- a/src/components/entity/state-info.ts +++ b/src/components/entity/state-info.ts @@ -28,7 +28,7 @@ class StateInfo extends LitElement { const name = computeStateName(this.stateObj); - return html` - ${entity.interfaces - .filter((ifc) => !IGNORE_INTERFACES.includes(ifc)) - .map((ifc) => ifc.replace(/(Alexa.|Controller)/g, "")) - .join(", ")} + ${entity.entity_id in this.hass.entities + ? html`` + : ""} ${!emptyFilter ? html`${iconButton}` @@ -323,23 +329,33 @@ class CloudAlexa extends SubscribeMixin(LitElement) { if (changedProps.has("cloudStatus")) { this._entityConfigs = this.cloudStatus.prefs.alexa_entity_configs; } + if ( + changedProps.has("hass") && + changedProps.get("hass")?.entities !== this.hass.entities + ) { + const categories = {}; + + for (const entry of Object.values(this.hass.entities)) { + categories[entry.entity_id] = entry.entity_category; + } + + this._entityCategories = categories; + } } - protected override hassSubscribe(): ( - | UnsubscribeFunc - | Promise - )[] { - return [ - subscribeEntityRegistry(this.hass.connection, (entries) => { - const categories = {}; - - for (const entry of entries) { - categories[entry.entity_id] = entry.entity_category; - } - - this._entityCategories = categories; - }), - ]; + private async _openAliasesSettings(ev) { + ev.stopPropagation(); + const entityId = ev.target.entityId; + const entry = await getExtendedEntityRegistryEntry(this.hass, entityId); + if (!entry) { + return; + } + showEntityAliasesDialog(this, { + entity: entry, + updateEntry: async (updates) => { + await updateEntityRegistryEntry(this.hass, entry.entity_id, updates); + }, + }); } private async _fetchData() { diff --git a/src/panels/config/cloud/google-assistant/cloud-google-assistant.ts b/src/panels/config/cloud/google-assistant/cloud-google-assistant.ts index 75d14227cc..92bf480175 100644 --- a/src/panels/config/cloud/google-assistant/cloud-google-assistant.ts +++ b/src/panels/config/cloud/google-assistant/cloud-google-assistant.ts @@ -9,7 +9,6 @@ import { mdiFormatListChecks, mdiSync, } from "@mdi/js"; -import type { UnsubscribeFunc } from "home-assistant-js-websocket"; import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; import { customElement, property, state } from "lit/decorators"; import { classMap } from "lit/directives/class-map"; @@ -41,7 +40,8 @@ import { } from "../../../../data/cloud"; import { EntityRegistryEntry, - subscribeEntityRegistry, + getExtendedEntityRegistryEntry, + updateEntityRegistryEntry, } from "../../../../data/entity_registry"; import { fetchCloudGoogleEntities, @@ -51,15 +51,15 @@ import { showDomainTogglerDialog } from "../../../../dialogs/domain-toggler/show import { showAlertDialog } from "../../../../dialogs/generic/show-dialog-box"; import "../../../../layouts/hass-loading-screen"; import "../../../../layouts/hass-subpage"; -import { SubscribeMixin } from "../../../../mixins/subscribe-mixin"; -import { haStyle } from "../../../../resources/styles"; +import { buttonLinkStyle, haStyle } from "../../../../resources/styles"; import type { HomeAssistant } from "../../../../types"; import { showToast } from "../../../../util/toast"; +import { showEntityAliasesDialog } from "../../entities/entity-aliases/show-dialog-entity-aliases"; const DEFAULT_CONFIG_EXPOSE = true; @customElement("cloud-google-assistant") -class CloudGoogleAssistant extends SubscribeMixin(LitElement) { +class CloudGoogleAssistant extends LitElement { @property({ attribute: false }) public hass!: HomeAssistant; @property() public cloudStatus!: CloudStatusLoggedIn; @@ -174,15 +174,23 @@ class CloudGoogleAssistant extends SubscribeMixin(LitElement) { secondary-line @click=${this._showMoreInfo} > - ${entity.traits - .map((trait) => trait.substr(trait.lastIndexOf(".") + 1)) - .join(", ")} + ${entity.entity_id in this.hass.entities + ? html`` + : ""} ${!emptyFilter ? html`${iconButton}` : html` ${iconButton} @@ -308,7 +316,7 @@ class CloudGoogleAssistant extends SubscribeMixin(LitElement) { ${!this.narrow ? this.hass!.localize( - "ui.panel.config.cloud.alexa.exposed", + "ui.panel.config.cloud.google.exposed", "selected", selected ) @@ -329,7 +337,7 @@ class CloudGoogleAssistant extends SubscribeMixin(LitElement) { ${!this.narrow ? this.hass!.localize( - "ui.panel.config.cloud.alexa.not_exposed", + "ui.panel.config.cloud.google.not_exposed", "selected", this._entities.length - selected ) @@ -354,23 +362,33 @@ class CloudGoogleAssistant extends SubscribeMixin(LitElement) { if (changedProps.has("cloudStatus")) { this._entityConfigs = this.cloudStatus.prefs.google_entity_configs; } + if ( + changedProps.has("hass") && + changedProps.get("hass")?.entities !== this.hass.entities + ) { + const categories = {}; + + for (const entry of Object.values(this.hass.entities)) { + categories[entry.entity_id] = entry.entity_category; + } + + this._entityCategories = categories; + } } - protected override hassSubscribe(): ( - | UnsubscribeFunc - | Promise - )[] { - return [ - subscribeEntityRegistry(this.hass.connection, (entries) => { - const categories = {}; - - for (const entry of entries) { - categories[entry.entity_id] = entry.entity_category; - } - - this._entityCategories = categories; - }), - ]; + private async _openAliasesSettings(ev) { + ev.stopPropagation(); + const entityId = ev.target.entityId; + const entry = await getExtendedEntityRegistryEntry(this.hass, entityId); + if (!entry) { + return; + } + showEntityAliasesDialog(this, { + entity: entry, + updateEntry: async (updates) => { + await updateEntityRegistryEntry(this.hass, entry.entity_id, updates); + }, + }); } private _configIsDomainExposed( @@ -583,6 +601,7 @@ class CloudGoogleAssistant extends SubscribeMixin(LitElement) { static get styles(): CSSResultGroup { return [ haStyle, + buttonLinkStyle, css` mwc-list-item > [slot="meta"] { margin-left: 4px; diff --git a/src/panels/config/entities/entity-aliases/show-dialog-entity-aliases.ts b/src/panels/config/entities/entity-aliases/show-dialog-entity-aliases.ts index d3fec599ec..0e9cbd9357 100644 --- a/src/panels/config/entities/entity-aliases/show-dialog-entity-aliases.ts +++ b/src/panels/config/entities/entity-aliases/show-dialog-entity-aliases.ts @@ -1,11 +1,11 @@ import { fireEvent } from "../../../../common/dom/fire_event"; import { - EntityRegistryEntry, EntityRegistryEntryUpdateParams, + ExtEntityRegistryEntry, } from "../../../../data/entity_registry"; export interface EntityAliasesDialogParams { - entity: EntityRegistryEntry; + entity: ExtEntityRegistryEntry; updateEntry: ( updates: Partial ) => Promise; diff --git a/src/panels/config/entities/ha-config-entities.ts b/src/panels/config/entities/ha-config-entities.ts index cafff74d14..5fb9d6bf9c 100644 --- a/src/panels/config/entities/ha-config-entities.ts +++ b/src/panels/config/entities/ha-config-entities.ts @@ -728,7 +728,6 @@ export class HaConfigEntities extends SubscribeMixin(LitElement) { selectable: false, entity_category: null, has_entity_name: false, - aliases: [], }); } if (changed) { diff --git a/src/panels/config/script/ha-script-trace.ts b/src/panels/config/script/ha-script-trace.ts index ae001665ca..a8addf7bd8 100644 --- a/src/panels/config/script/ha-script-trace.ts +++ b/src/panels/config/script/ha-script-trace.ts @@ -527,15 +527,10 @@ export class HaScriptTrace extends LitElement { :host([narrow]) .graph { max-width: 100%; } - .info { flex: 1; background-color: var(--card-background-color); } - - .linkButton { - color: var(--primary-text-color); - } .trace-link { text-decoration: none; } diff --git a/src/translations/en.json b/src/translations/en.json index f0b5e00104..91de8f9abe 100755 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -2634,7 +2634,7 @@ "enable_state_reporting": "Enable State Reporting", "info_state_reporting": "If you enable state reporting, Home Assistant will send all state changes of exposed entities to Amazon. This allows you to always see the latest states in the Alexa app and use the state changes to create routines.", "state_reporting_error": "Unable to {enable_disable} report state.", - "manage_entities": "Manage Entities", + "manage_entities": "[%key:ui::panel::config::cloud::account::google::manage_entities%]", "enable": "enable", "disable": "disable", "not_configured_title": "Alexa is not activated", @@ -2685,6 +2685,7 @@ "follow_domain": "[%key:ui::panel::config::cloud::google::follow_domain%]", "exposed": "[%key:ui::panel::config::cloud::google::exposed%]", "not_exposed": "[%key:ui::panel::config::cloud::google::not_exposed%]", + "manage_aliases": "[%key:ui::panel::config::cloud::google::manage_aliases%]", "expose": "Expose to Alexa", "sync_entities": "Synchronize entities", "sync_entities_error": "Failed to sync entities:" @@ -2710,6 +2711,7 @@ "follow_domain": "Follow domain", "exposed": "{selected} exposed", "not_exposed": "{selected} not exposed", + "manage_aliases": "Manage aliases", "sync_to_google": "Synchronizing changes to Google.", "sync_entities": "Synchronize entities", "sync_entities_error": "Failed to sync entities:", From afcd45a780338ac64f40d1a07fb12edd2d49f3e3 Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Mon, 2 Jan 2023 21:17:14 +0100 Subject: [PATCH 5/9] Enable unit conversion for DATA_SIZE (#14903) Co-authored-by: Bram Kragten --- .../entities/entity-registry-settings.ts | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/panels/config/entities/entity-registry-settings.ts b/src/panels/config/entities/entity-registry-settings.ts index 177f9bfc15..9fc640993f 100644 --- a/src/panels/config/entities/entity-registry-settings.ts +++ b/src/panels/config/entities/entity-registry-settings.ts @@ -132,6 +132,29 @@ const OVERRIDE_SENSOR_UNITS = { "MiB/s", "GiB/s", ], + data_size: [ + "bit", + "kbit", + "Mbit", + "Gbit", + "B", + "kB", + "MB", + "GB", + "TB", + "PB", + "EB", + "ZB", + "YB", + "KiB", + "MiB", + "GiB", + "TiB", + "PiB", + "EiB", + "ZiB", + "YiB", + ], distance: ["cm", "ft", "in", "km", "m", "mi", "mm", "yd"], gas: ["CCF", "ft³", "m³"], precipitation: ["cm", "in", "mm"], From e3ac2c149d4b3bc2fb16078c2532543f7150ecd6 Mon Sep 17 00:00:00 2001 From: Allen Porter Date: Mon, 2 Jan 2023 12:19:36 -0800 Subject: [PATCH 6/9] Use translations for all fields in recurrence rule editor (#14940) Co-authored-by: Bram Kragten --- .../calendar/ha-recurrence-rule-editor.ts | 80 ++++++++++++++----- src/panels/calendar/recurrence.ts | 20 ----- src/translations/en.json | 27 +++++++ 3 files changed, 88 insertions(+), 39 deletions(-) diff --git a/src/panels/calendar/ha-recurrence-rule-editor.ts b/src/panels/calendar/ha-recurrence-rule-editor.ts index d2965e0284..5d8af6c2a9 100644 --- a/src/panels/calendar/ha-recurrence-rule-editor.ts +++ b/src/panels/calendar/ha-recurrence-rule-editor.ts @@ -6,6 +6,7 @@ import type { Options, WeekdayStr } from "rrule"; import { ByWeekday, RRule, Weekday } from "rrule"; import { firstWeekdayIndex } from "../../common/datetime/first_weekday"; import { stopPropagation } from "../../common/dom/stop_propagation"; +import { LocalizeKeys } from "../../common/translations/localize"; import "../../components/ha-chip"; import "../../components/ha-list-item"; import "../../components/ha-select"; @@ -19,12 +20,10 @@ import { getWeekday, getWeekdays, getMonthlyRepeatItems, - intervalSuffix, RepeatEnd, RepeatFrequency, ruleByWeekDay, untilValue, - WEEKDAY_NAME, MonthlyRepeatItem, getMonthlyRepeatWeekdayFromRule, getMonthdayRepeatFromRule, @@ -174,18 +173,36 @@ export class RecurrenceRuleEditor extends LitElement { return html` - None - Yearly - Monthly - Weekly - Daily + + ${this.hass.localize("ui.components.calendar.event.repeat.freq.none")} + + + ${this.hass.localize( + "ui.components.calendar.event.repeat.freq.yearly" + )} + + + ${this.hass.localize( + "ui.components.calendar.event.repeat.freq.monthly" + )} + + + ${this.hass.localize( + "ui.components.calendar.event.repeat.freq.weekly" + )} + + + ${this.hass.localize( + "ui.components.calendar.event.repeat.freq.daily" + )} + `; } @@ -196,7 +213,9 @@ export class RecurrenceRuleEditor extends LitElement { ${this._monthlyRepeatItems.length > 0 ? html`${WEEKDAY_NAME[item]}${this.hass.localize( + `ui.components.calendar.event.repeat.weekly.weekday.${ + item.toLowerCase() as Lowercase + }` + )} ` )} @@ -241,11 +264,16 @@ export class RecurrenceRuleEditor extends LitElement { return html` `; @@ -255,26 +283,38 @@ export class RecurrenceRuleEditor extends LitElement { return html` - Never - After - On + + ${this.hass.localize("ui.components.calendar.event.repeat.end.never")} + + + ${this.hass.localize("ui.components.calendar.event.repeat.end.after")} + + + ${this.hass.localize("ui.components.calendar.event.repeat.end.on")} + ${this._end === "after" ? html` ` @@ -283,7 +323,9 @@ export class RecurrenceRuleEditor extends LitElement { ? html` Date: Mon, 2 Jan 2023 21:27:30 +0100 Subject: [PATCH 7/9] Do not close aliases dialog on enter (#14952) Co-authored-by: Bram Kragten --- src/components/ha-dialog.ts | 12 +++++++++++- .../entity-aliases/dialog-entity-aliases.ts | 18 +++++++++++++++--- .../entities/entity-registry-basic-editor.ts | 11 ++++------- .../entities/entity-registry-settings.ts | 11 ++++------- src/translations/en.json | 3 ++- 5 files changed, 36 insertions(+), 19 deletions(-) diff --git a/src/components/ha-dialog.ts b/src/components/ha-dialog.ts index f3995a7737..1e69ad2ac4 100644 --- a/src/components/ha-dialog.ts +++ b/src/components/ha-dialog.ts @@ -3,10 +3,12 @@ import { styles } from "@material/mwc-dialog/mwc-dialog.css"; import { mdiClose } from "@mdi/js"; import { css, html, TemplateResult } from "lit"; import { customElement } from "lit/decorators"; -import type { HomeAssistant } from "../types"; import { FOCUS_TARGET } from "../dialogs/make-dialog-manager"; +import type { HomeAssistant } from "../types"; import "./ha-icon-button"; +const SUPPRESS_DEFAULT_PRESS_SELECTOR = ["button"]; + export const createCloseHeading = ( hass: HomeAssistant, title: string | TemplateResult @@ -32,6 +34,14 @@ export class HaDialog extends DialogBase { return html` ${super.renderHeading()} `; } + protected firstUpdated(): void { + super.firstUpdated(); + this.suppressDefaultPressSelector = [ + this.suppressDefaultPressSelector, + SUPPRESS_DEFAULT_PRESS_SELECTOR, + ].join(", "); + } + static override styles = [ styles, css` diff --git a/src/panels/config/entities/entity-aliases/dialog-entity-aliases.ts b/src/panels/config/entities/entity-aliases/dialog-entity-aliases.ts index 29e3e012cc..9859bcf602 100644 --- a/src/panels/config/entities/entity-aliases/dialog-entity-aliases.ts +++ b/src/panels/config/entities/entity-aliases/dialog-entity-aliases.ts @@ -72,16 +72,21 @@ class DialogEntityAliases extends LitElement { dialogInitialFocus=${index} .index=${index} class="flex-auto" - label="Alias" + .label=${this.hass!.localize( + "ui.dialogs.entity_registry.editor.aliases.input_label", + { number: index + 1 } + )} .value=${alias} ?data-last=${index === this._aliases.length - 1} - @change=${this._editAlias} + @input=${this._editAlias} + @keydown=${this._keyDownAlias} > { @@ -272,12 +273,8 @@ export class HaEntityRegistryBasicEditor extends SubscribeMixin(LitElement) { "ui.dialogs.entity_registry.editor.aliases_section" )} - - 0} - hasMeta - @click=${this._openAliasesSettings} - > + + 0} hasMeta> ${this.entry.aliases.length > 0 ? this.hass.localize( diff --git a/src/panels/config/entities/entity-registry-settings.ts b/src/panels/config/entities/entity-registry-settings.ts index 9fc640993f..5a318ff9ed 100644 --- a/src/panels/config/entities/entity-registry-settings.ts +++ b/src/panels/config/entities/entity-registry-settings.ts @@ -807,12 +807,8 @@ export class EntityRegistrySettings extends SubscribeMixin(LitElement) { "ui.dialogs.entity_registry.editor.aliases_section" )} - - 0} - hasMeta - @click=${this._openAliasesSettings} - > + + 0} hasMeta> ${this.entry.aliases.length > 0 ? this.hass.localize( @@ -1015,7 +1011,8 @@ export class EntityRegistrySettings extends SubscribeMixin(LitElement) { }); } - private _openAliasesSettings() { + private _handleAliasesClicked(ev: CustomEvent) { + if (ev.detail.index !== 0) return; showEntityAliasesDialog(this, { entity: this.entry!, updateEntry: async (updates) => { diff --git a/src/translations/en.json b/src/translations/en.json index ff490edd2c..df3e8b1c90 100755 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -1003,7 +1003,8 @@ "aliases": { "heading": "{name} aliases", "description": "Aliases are alternative names used in voice assistants to refer to this entity.", - "remove_alias": "Remove alias", + "remove_alias": "Remove alias {number}", + "input_label": "Alias {number}", "save": "Save", "add_alias": "Add alias", "no_aliases": "No aliases have been added yet", From 3cc1cb7893829ed541561f99c61b371eb05076f2 Mon Sep 17 00:00:00 2001 From: Allen Porter Date: Mon, 2 Jan 2023 12:27:50 -0800 Subject: [PATCH 8/9] Rollback calendar trigger day offset support (#14933) --- .../automation/trigger/types/ha-automation-trigger-calendar.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/panels/config/automation/trigger/types/ha-automation-trigger-calendar.ts b/src/panels/config/automation/trigger/types/ha-automation-trigger-calendar.ts index c9cccc4795..846d22a5d5 100644 --- a/src/panels/config/automation/trigger/types/ha-automation-trigger-calendar.ts +++ b/src/panels/config/automation/trigger/types/ha-automation-trigger-calendar.ts @@ -46,7 +46,7 @@ export class HaCalendarTrigger extends LitElement implements TriggerElement { ], ], }, - { name: "offset", selector: { duration: { enable_day: true } } }, + { name: "offset", selector: { duration: {} } }, { name: "offset_type", type: "select", From 44d91eaa4f2225e4e76931f5868618abd22c6835 Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Mon, 2 Jan 2023 21:28:30 +0100 Subject: [PATCH 9/9] Bumped version to 20230102.0 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 5095848ad9..776a80fa6b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "home-assistant-frontend" -version = "20221230.0" +version = "20230102.0" license = {text = "Apache-2.0"} description = "The Home Assistant frontend" readme = "README.md"