this._createNew(ev)}
+ @click=${this._createNew}
>
${this.hass.localize(
"ui.panel.config.blueprint.overview.use_blueprint"
@@ -154,7 +154,7 @@ class HaBlueprintOverview extends LitElement {
? "ui.panel.config.blueprint.overview.share_blueprint"
: "ui.panel.config.blueprint.overview.share_blueprint_no_url"
)}
- @click=${(ev) => this._share(ev)}
+ @click=${this._share}
>`,
},
@@ -169,7 +169,7 @@ class HaBlueprintOverview extends LitElement {
.label=${this.hass.localize(
"ui.panel.config.blueprint.overview.delete_blueprint"
)}
- @click=${(ev) => this._delete(ev)}
+ @click=${this._delete}
>`,
},
@@ -275,12 +275,12 @@ class HaBlueprintOverview extends LitElement {
fireEvent(this, "reload-blueprints");
}
- private _createNew(ev) {
+ private _createNew = (ev) => {
const blueprint = ev.currentTarget.blueprint as BlueprintMetaDataPath;
createNewFunctions[blueprint.domain](blueprint);
- }
+ };
- private _share(ev) {
+ private _share = (ev) => {
const blueprint = ev.currentTarget.blueprint;
const params = new URLSearchParams();
params.append("redirect", "blueprint_import");
@@ -288,9 +288,9 @@ class HaBlueprintOverview extends LitElement {
window.open(
`https://my.home-assistant.io/create-link/?${params.toString()}`
);
- }
+ };
- private async _delete(ev) {
+ private _delete = async (ev) => {
const blueprint = ev.currentTarget.blueprint;
if (
!(await showConfirmationDialog(this, {
@@ -306,7 +306,7 @@ class HaBlueprintOverview extends LitElement {
}
await deleteBlueprint(this.hass, blueprint.domain, blueprint.path);
fireEvent(this, "reload-blueprints");
- }
+ };
static get styles(): CSSResultGroup {
return haStyle;
diff --git a/src/panels/config/integrations/integration-panels/zha/zha-network-visualization-page.ts b/src/panels/config/integrations/integration-panels/zha/zha-network-visualization-page.ts
index 9923da8054..737f504a2f 100644
--- a/src/panels/config/integrations/integration-panels/zha/zha-network-visualization-page.ts
+++ b/src/panels/config/integrations/integration-panels/zha/zha-network-visualization-page.ts
@@ -173,7 +173,7 @@ export class ZHANetworkVisualizationPage extends LitElement {
.label=${this.hass.localize(
"ui.panel.config.zha.visualization.zoom_label"
)}
- .deviceFilter=${(device) => this._filterDevices(device)}
+ .deviceFilter=${this._filterDevices}
@value-changed=${this._onZoomToDevice}
>
@@ -359,7 +359,7 @@ export class ZHANetworkVisualizationPage extends LitElement {
await refreshTopology(this.hass);
}
- private _filterDevices(device: DeviceRegistryEntry): boolean {
+ private _filterDevices = (device: DeviceRegistryEntry): boolean => {
if (!this.hass) {
return false;
}
@@ -371,7 +371,7 @@ export class ZHANetworkVisualizationPage extends LitElement {
}
}
return false;
- }
+ };
private _handleCheckboxChange(ev: Event) {
this._autoZoom = (ev.target as HaCheckbox).checked;
diff --git a/src/panels/config/scene/ha-scene-dashboard.ts b/src/panels/config/scene/ha-scene-dashboard.ts
index 7e16e04578..a3399fc85a 100644
--- a/src/panels/config/scene/ha-scene-dashboard.ts
+++ b/src/panels/config/scene/ha-scene-dashboard.ts
@@ -77,7 +77,7 @@ class HaSceneDashboard extends LitElement {
title=${this.hass.localize(
"ui.panel.config.scene.picker.activate_scene"
)}
- @click=${(ev: Event) => this._activateScene(ev)}
+ @click=${this._activateScene}
>
@@ -213,7 +213,7 @@ class HaSceneDashboard extends LitElement {
fireEvent(this, "hass-more-info", { entityId });
}
- private async _activateScene(ev) {
+ private _activateScene = async (ev) => {
ev.stopPropagation();
const scene = ev.currentTarget.scene as SceneEntity;
await activateScene(this.hass, scene.entity_id);
@@ -225,7 +225,7 @@ class HaSceneDashboard extends LitElement {
),
});
forwardHaptic("light");
- }
+ };
private _showHelp() {
showAlertDialog(this, {
diff --git a/src/panels/config/scene/ha-scene-editor.ts b/src/panels/config/scene/ha-scene-editor.ts
index 460c04b4bd..6c51a61af4 100644
--- a/src/panels/config/scene/ha-scene-editor.ts
+++ b/src/panels/config/scene/ha-scene-editor.ts
@@ -201,7 +201,7 @@ export class HaSceneEditor extends SubscribeMixin(
.hass=${this.hass}
.narrow=${this.narrow}
.route=${this.route}
- .backCallback=${() => this._backTapped()}
+ .backCallback=${this._backTapped}
.tabs=${configSections.automation}
>
{
if (this._dirty) {
showConfirmationDialog(this, {
text: this.hass!.localize(
@@ -711,7 +711,7 @@ export class HaSceneEditor extends SubscribeMixin(
} else {
this._goBack();
}
- }
+ };
private _goBack(): void {
applyScene(this.hass, this._storedStates);
diff --git a/src/panels/config/script/ha-script-editor.ts b/src/panels/config/script/ha-script-editor.ts
index 5830b81e45..ccba2b3ecd 100644
--- a/src/panels/config/script/ha-script-editor.ts
+++ b/src/panels/config/script/ha-script-editor.ts
@@ -87,7 +87,7 @@ export class HaScriptEditor extends KeyboardShortcutMixin(LitElement) {
.hass=${this.hass}
.narrow=${this.narrow}
.route=${this.route}
- .backCallback=${() => this._backTapped()}
+ .backCallback=${this._backTapped}
.tabs=${configSections.automation}
>
{
if (this._dirty) {
showConfirmationDialog(this, {
text: this.hass!.localize(
@@ -591,7 +591,7 @@ export class HaScriptEditor extends KeyboardShortcutMixin(LitElement) {
} else {
history.back();
}
- }
+ };
private async _duplicate() {
if (this._dirty) {
diff --git a/src/panels/config/script/ha-script-picker.ts b/src/panels/config/script/ha-script-picker.ts
index 3cdd49aff0..c29c647d4d 100644
--- a/src/panels/config/script/ha-script-picker.ts
+++ b/src/panels/config/script/ha-script-picker.ts
@@ -79,7 +79,7 @@ class HaScriptPicker extends LitElement {
title=${this.hass.localize(
"ui.panel.config.script.picker.run_script"
)}
- @click=${(ev: Event) => this._runScript(ev)}
+ @click=${this._runScript}
>
@@ -234,7 +234,7 @@ class HaScriptPicker extends LitElement {
this._filterValue = undefined;
}
- private async _runScript(ev) {
+ private _runScript = async (ev) => {
ev.stopPropagation();
const script = ev.currentTarget.script as HassEntity;
await triggerScript(this.hass, script.entity_id);
@@ -245,7 +245,7 @@ class HaScriptPicker extends LitElement {
computeStateName(script)
),
});
- }
+ };
private _showInfo(ev) {
ev.stopPropagation();
diff --git a/src/panels/config/script/ha-script-trace.ts b/src/panels/config/script/ha-script-trace.ts
index ca0a916b92..01a6f81c74 100644
--- a/src/panels/config/script/ha-script-trace.ts
+++ b/src/panels/config/script/ha-script-trace.ts
@@ -88,7 +88,7 @@ export class HaScriptTrace extends LitElement {
}
const actionButtons = html`
- this._loadTraces()}>
+
html`
- this._openWrite((ev.currentTarget as any).tag)}
+ @click=${this._handleWriteClick}
title=${this.hass.localize("ui.panel.config.tag.write")}
>
@@ -120,8 +119,7 @@ export class HaConfigTags extends SubscribeMixin(LitElement) {
type: "icon-button",
template: (_automation, tag: any) => html`
- this._createAutomation((ev.currentTarget as any).tag)}
+ @click=${this._handleAutomationClick}
title=${this.hass.localize("ui.panel.config.tag.create_automation")}
>
@@ -132,8 +130,7 @@ export class HaConfigTags extends SubscribeMixin(LitElement) {
type: "icon-button",
template: (_settings, tag: any) => html`
- this._openDialog((ev.currentTarget as any).tag)}
+ @click=${this._handleEditClick}
title=${this.hass.localize("ui.panel.config.tag.edit")}
>
@@ -209,6 +206,25 @@ export class HaConfigTags extends SubscribeMixin(LitElement) {
`;
}
+ private _handleWriteClick = (ev: Event) =>
+ this._openWrite((ev.currentTarget as any).tag);
+
+ private _handleAutomationClick = (ev: Event) => {
+ const tag = (ev.currentTarget as any).tag;
+ const data = {
+ alias: this.hass.localize(
+ "ui.panel.config.tag.automation_title",
+ "name",
+ tag.name || tag.id
+ ),
+ trigger: [{ platform: "tag", tag_id: tag.id } as TagTrigger],
+ };
+ showAutomationEditor(data);
+ };
+
+ private _handleEditClick = (ev: Event) =>
+ this._openDialog((ev.currentTarget as any).tag);
+
private _showHelp() {
showAlertDialog(this, {
title: this.hass.localize("ui.panel.config.tag.caption"),
@@ -251,18 +267,6 @@ export class HaConfigTags extends SubscribeMixin(LitElement) {
});
}
- private _createAutomation(tag: Tag) {
- const data = {
- alias: this.hass.localize(
- "ui.panel.config.tag.automation_title",
- "name",
- tag.name || tag.id
- ),
- trigger: [{ platform: "tag", tag_id: tag.id } as TagTrigger],
- };
- showAutomationEditor(data);
- }
-
private _addTag() {
this._openDialog();
}
diff --git a/src/panels/developer-tools/statistics/developer-tools-statistics.ts b/src/panels/developer-tools/statistics/developer-tools-statistics.ts
index 12dce6fb75..f0d9c13504 100644
--- a/src/panels/developer-tools/statistics/developer-tools-statistics.ts
+++ b/src/panels/developer-tools/statistics/developer-tools-statistics.ts
@@ -41,7 +41,6 @@ class HaPanelDevStatistics extends LitElement {
this._validateStatistics();
}
- /* eslint-disable lit/no-template-arrow */
private _columns = memoizeOne(
(localize): DataTableColumnContainer => ({
state: {
@@ -88,10 +87,7 @@ class HaPanelDevStatistics extends LitElement {
title: "",
template: (_, data: any) =>
html`${data.issues
- ? html` this._fixIssue(ev)}
- .data=${data.issues}
- >
+ ? html`
Fix issue
`
: ""}`,
@@ -99,7 +95,6 @@ class HaPanelDevStatistics extends LitElement {
},
})
);
- /* eslint-enable lit/no-template-arrow */
protected render() {
return html`
@@ -150,7 +145,7 @@ class HaPanelDevStatistics extends LitElement {
});
}
- private _fixIssue(ev) {
+ private _fixIssue = (ev) => {
const issues = (ev.currentTarget.data as StatisticsValidationResult[]).sort(
(itemA, itemB) =>
(FIX_ISSUES_ORDER[itemA.type] ?? 99) -
@@ -236,7 +231,7 @@ class HaPanelDevStatistics extends LitElement {
text: "Fixing this issue is not supported yet.",
});
}
- }
+ };
static get styles(): CSSResultGroup {
return [
diff --git a/src/panels/lovelace/editor/card-editor/hui-dialog-create-card.ts b/src/panels/lovelace/editor/card-editor/hui-dialog-create-card.ts
index 0c7a2a74c4..33e8e8b443 100644
--- a/src/panels/lovelace/editor/card-editor/hui-dialog-create-card.ts
+++ b/src/panels/lovelace/editor/card-editor/hui-dialog-create-card.ts
@@ -90,8 +90,7 @@ export class HuiCreateDialogCard
- this._handleTabChanged(ev)}
+ @MDCTabBar:activated=${this._handleTabChanged}
>