diff --git a/src/panels/config/devices/ha-config-devices-dashboard.ts b/src/panels/config/devices/ha-config-devices-dashboard.ts index 0c4bc1ab69..1ed9f65bbb 100644 --- a/src/panels/config/devices/ha-config-devices-dashboard.ts +++ b/src/panels/config/devices/ha-config-devices-dashboard.ts @@ -626,7 +626,7 @@ export class HaConfigDeviceDashboard extends SubscribeMixin(LitElement) { (area) => html` ${area.icon ? html`` @@ -637,7 +637,7 @@ export class HaConfigDeviceDashboard extends SubscribeMixin(LitElement) {
${area.name}
` )} - +
${this.hass.localize( "ui.panel.config.devices.picker.bulk_actions.no_area" @@ -645,7 +645,7 @@ export class HaConfigDeviceDashboard extends SubscribeMixin(LitElement) {
- +
${this.hass.localize( "ui.panel.config.devices.picker.bulk_actions.add_area" @@ -684,7 +684,7 @@ export class HaConfigDeviceDashboard extends SubscribeMixin(LitElement) { `; })} - +
${this.hass.localize("ui.panel.config.labels.add_label")}
{ + const area = item.value; this._bulkAddArea(area); - } + }; private async _bulkAddArea(area: string) { const promises: Promise[] = []; @@ -999,7 +999,7 @@ ${rejected } } - private async _bulkCreateArea() { + private _bulkCreateArea = () => { showAreaRegistryDetailDialog(this, { createEntry: async (values) => { const area = await createAreaRegistryEntry(this.hass, values); @@ -1007,7 +1007,7 @@ ${rejected return area; }, }); - } + }; private async _handleBulkLabel(ev) { const label = ev.currentTarget.value; @@ -1045,7 +1045,7 @@ ${rejected } } - private _bulkCreateLabel() { + private _bulkCreateLabel = () => { showLabelDetailDialog(this, { createEntry: async (values) => { const label = await createLabelRegistryEntry(this.hass, values); @@ -1053,7 +1053,7 @@ ${rejected return label; }, }); - } + }; private _handleSortingChanged(ev: CustomEvent) { this._activeSorting = ev.detail; diff --git a/src/panels/config/helpers/ha-config-helpers.ts b/src/panels/config/helpers/ha-config-helpers.ts index a9876f8917..7b20c37c08 100644 --- a/src/panels/config/helpers/ha-config-helpers.ts +++ b/src/panels/config/helpers/ha-config-helpers.ts @@ -561,7 +561,7 @@ export class HaConfigHelpers extends SubscribeMixin(LitElement) { (category) => html` ${category.icon ? html`` @@ -569,7 +569,7 @@ export class HaConfigHelpers extends SubscribeMixin(LitElement) {
${category.name}
` )} - +
${this.hass.localize( "ui.panel.config.automation.picker.bulk_actions.no_category" @@ -577,7 +577,7 @@ export class HaConfigHelpers extends SubscribeMixin(LitElement) {
- +
${this.hass.localize("ui.panel.config.category.editor.add")}
@@ -612,7 +612,7 @@ export class HaConfigHelpers extends SubscribeMixin(LitElement) {
`; })} - +
${this.hass.localize("ui.panel.config.labels.add_label")}
@@ -958,10 +958,10 @@ export class HaConfigHelpers extends SubscribeMixin(LitElement) { }); } - private async _handleBulkCategory(ev) { - const category = ev.currentTarget.value; + private _handleBulkCategory = (item) => { + const category = item.value; this._bulkAddCategory(category); - } + }; private async _bulkAddCategory(category: string) { const promises: Promise[] = []; @@ -1234,7 +1234,7 @@ ${rejected showHelperDetailDialog(this, {}); } - private async _bulkCreateCategory() { + private _bulkCreateCategory = () => { showCategoryRegistryDetailDialog(this, { scope: "helpers", createEntry: async (values) => { @@ -1247,9 +1247,9 @@ ${rejected return category; }, }); - } + }; - private _bulkCreateLabel() { + private _bulkCreateLabel = () => { showLabelDetailDialog(this, { createEntry: async (values) => { const label = await createLabelRegistryEntry(this.hass, values); @@ -1257,7 +1257,7 @@ ${rejected return label; }, }); - } + }; private _handleSortingChanged(ev: CustomEvent) { this._activeSorting = ev.detail; diff --git a/src/panels/config/scene/ha-scene-dashboard.ts b/src/panels/config/scene/ha-scene-dashboard.ts index ef1563fe21..c83b82c00a 100644 --- a/src/panels/config/scene/ha-scene-dashboard.ts +++ b/src/panels/config/scene/ha-scene-dashboard.ts @@ -420,7 +420,7 @@ class HaSceneDashboard extends SubscribeMixin(LitElement) { (category) => html` ${category.icon ? html`` @@ -428,7 +428,7 @@ class HaSceneDashboard extends SubscribeMixin(LitElement) {
${category.name}
` )} - +
${this.hass.localize( "ui.panel.config.automation.picker.bulk_actions.no_category" @@ -436,7 +436,7 @@ class HaSceneDashboard extends SubscribeMixin(LitElement) {
- +
${this.hass.localize("ui.panel.config.category.editor.add")}
@@ -473,7 +473,7 @@ class HaSceneDashboard extends SubscribeMixin(LitElement) {
`; })} - +
${this.hass.localize("ui.panel.config.labels.add_label")}
html` ${area.icon ? html`` @@ -494,7 +494,7 @@ class HaSceneDashboard extends SubscribeMixin(LitElement) {
${area.name}
` )} - +
${this.hass.localize( "ui.panel.config.devices.picker.bulk_actions.no_area" @@ -502,7 +502,7 @@ class HaSceneDashboard extends SubscribeMixin(LitElement) {
- +
${this.hass.localize( "ui.panel.config.devices.picker.bulk_actions.add_area" @@ -932,10 +932,10 @@ class HaSceneDashboard extends SubscribeMixin(LitElement) { } } - private async _handleBulkCategory(ev) { - const category = ev.currentTarget.value; + private _handleBulkCategory = (item) => { + const category = item.value; this._bulkAddCategory(category); - } + }; private async _bulkAddCategory(category: string) { const promises: Promise[] = []; @@ -998,10 +998,10 @@ ${rejected } } - private async _handleBulkArea(ev) { - const area = ev.currentTarget.value; + private _handleBulkArea = (item) => { + const area = item.value; this._bulkAddArea(area); - } + }; private async _bulkAddArea(area: string) { const promises: Promise[] = []; @@ -1028,7 +1028,7 @@ ${rejected } } - private async _bulkCreateArea() { + private _bulkCreateArea = () => { showAreaRegistryDetailDialog(this, { createEntry: async (values) => { const area = await createAreaRegistryEntry(this.hass, values); @@ -1036,7 +1036,7 @@ ${rejected return area; }, }); - } + }; private _editCategory(scene: any) { const entityReg = this._entityReg.find( @@ -1133,7 +1133,7 @@ ${rejected }); } - private async _bulkCreateCategory() { + private _bulkCreateCategory = () => { showCategoryRegistryDetailDialog(this, { scope: "scene", createEntry: async (values) => { @@ -1146,9 +1146,9 @@ ${rejected return category; }, }); - } + }; - private _bulkCreateLabel() { + private _bulkCreateLabel = () => { showLabelDetailDialog(this, { createEntry: async (values) => { const label = await createLabelRegistryEntry(this.hass, values); @@ -1156,7 +1156,7 @@ ${rejected return label; }, }); - } + }; private _handleSortingChanged(ev: CustomEvent) { this._activeSorting = ev.detail; diff --git a/src/panels/config/script/ha-script-picker.ts b/src/panels/config/script/ha-script-picker.ts index 7d72bcefc1..0fa9fd4393 100644 --- a/src/panels/config/script/ha-script-picker.ts +++ b/src/panels/config/script/ha-script-picker.ts @@ -410,7 +410,7 @@ class HaScriptPicker extends SubscribeMixin(LitElement) { (category) => html` ${category.icon ? html`` @@ -418,14 +418,14 @@ class HaScriptPicker extends SubscribeMixin(LitElement) {
${category.name}
` )} - +
${this.hass.localize( "ui.panel.config.automation.picker.bulk_actions.no_category" )}
- +
${this.hass.localize("ui.panel.config.category.editor.add")}
@@ -462,7 +462,7 @@ class HaScriptPicker extends SubscribeMixin(LitElement) {
`; })} - +
${this.hass.localize("ui.panel.config.labels.add_label")}
html` ${area.icon ? html`` @@ -483,7 +483,7 @@ class HaScriptPicker extends SubscribeMixin(LitElement) {
${area.name}
` )} - +
${this.hass.localize( "ui.panel.config.devices.picker.bulk_actions.no_area" @@ -491,7 +491,7 @@ class HaScriptPicker extends SubscribeMixin(LitElement) {
- +
${this.hass.localize( "ui.panel.config.devices.picker.bulk_actions.add_area" @@ -977,10 +977,10 @@ class HaScriptPicker extends SubscribeMixin(LitElement) { this._selected = ev.detail.value; } - private async _handleBulkCategory(ev) { - const category = ev.currentTarget.value; + private _handleBulkCategory = (item) => { + const category = item.value; this._bulkAddCategory(category); - } + }; private async _bulkAddCategory(category: string) { const promises: Promise[] = []; @@ -1185,7 +1185,7 @@ ${rejected } } - private async _bulkCreateCategory() { + private _bulkCreateCategory = () => { showCategoryRegistryDetailDialog(this, { scope: "script", createEntry: async (values) => { @@ -1198,9 +1198,9 @@ ${rejected return category; }, }); - } + }; - private _bulkCreateLabel() { + private _bulkCreateLabel = () => { showLabelDetailDialog(this, { createEntry: async (values) => { const label = await createLabelRegistryEntry(this.hass, values); @@ -1208,12 +1208,12 @@ ${rejected return label; }, }); - } + }; - private async _handleBulkArea(ev) { - const area = ev.currentTarget.value; + private _handleBulkArea = (item) => { + const area = item.value; this._bulkAddArea(area); - } + }; private async _bulkAddArea(area: string) { const promises: Promise[] = []; @@ -1240,7 +1240,7 @@ ${rejected } } - private async _bulkCreateArea() { + private _bulkCreateArea = () => { showAreaRegistryDetailDialog(this, { createEntry: async (values) => { const area = await createAreaRegistryEntry(this.hass, values); @@ -1248,7 +1248,7 @@ ${rejected return area; }, }); - } + }; private _handleSortingChanged(ev: CustomEvent) { this._activeSorting = ev.detail;