From 68e13786154da44642ceb7400b6f7bb66e11ff67 Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Tue, 28 Jul 2020 11:12:58 +0200 Subject: [PATCH] Fix automation/scripts dirty on start edit (#6474) --- src/panels/config/automation/ha-automation-editor.ts | 4 ++++ src/panels/config/script/ha-script-editor.ts | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/panels/config/automation/ha-automation-editor.ts b/src/panels/config/automation/ha-automation-editor.ts index afcc21ae86..5d680aad96 100644 --- a/src/panels/config/automation/ha-automation-editor.ts +++ b/src/panels/config/automation/ha-automation-editor.ts @@ -411,6 +411,10 @@ export class HaAutomationEditor extends LitElement { const mode = ((ev.target as PaperListboxElement)?.selectedItem as any) ?.mode; + if (mode === this._config!.mode) { + return; + } + this._config = { ...this._config!, mode }; if (!MODES_MAX.includes(mode)) { delete this._config.max; diff --git a/src/panels/config/script/ha-script-editor.ts b/src/panels/config/script/ha-script-editor.ts index 4eb1ca6e65..807e2cbef8 100644 --- a/src/panels/config/script/ha-script-editor.ts +++ b/src/panels/config/script/ha-script-editor.ts @@ -306,6 +306,10 @@ export class HaScriptEditor extends LitElement { const mode = ((ev.target as PaperListboxElement)?.selectedItem as any) ?.mode; + if (mode === this._config!.mode) { + return; + } + this._config = { ...this._config!, mode }; if (!MODES_MAX.includes(mode)) { delete this._config.max;