From 07bc9081b8ae6e657ee76bfa38017f1cce12e1e5 Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Tue, 6 Sep 2022 00:46:30 +0200 Subject: [PATCH] dont remove id from automation config (#13609) --- src/panels/config/automation/ha-automation-editor.ts | 8 +++----- src/panels/config/hardware/ha-config-hardware.ts | 4 ++-- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/panels/config/automation/ha-automation-editor.ts b/src/panels/config/automation/ha-automation-editor.ts index 936c45eb3c..1e0a0dba43 100644 --- a/src/panels/config/automation/ha-automation-editor.ts +++ b/src/panels/config/automation/ha-automation-editor.ts @@ -498,13 +498,11 @@ export class HaAutomationEditor extends KeyboardShortcutMixin(LitElement) { } private _preprocessYaml() { - const cleanConfig = this._config; - if (!cleanConfig) { + if (!this._config) { return {}; } - + const cleanConfig: AutomationConfig = { ...this._config }; delete cleanConfig.id; - return cleanConfig; } @@ -522,7 +520,7 @@ export class HaAutomationEditor extends KeyboardShortcutMixin(LitElement) { if (!ev.detail.isValid) { return; } - this._config = ev.detail.value; + this._config = { id: this._config?.id, ...ev.detail.value }; this._errors = undefined; this._dirty = true; } diff --git a/src/panels/config/hardware/ha-config-hardware.ts b/src/panels/config/hardware/ha-config-hardware.ts index 6806eb5cb0..a84c053584 100644 --- a/src/panels/config/hardware/ha-config-hardware.ts +++ b/src/panels/config/hardware/ha-config-hardware.ts @@ -175,7 +175,7 @@ class HaConfigHardware extends SubscribeMixin(LitElement) { let documentationURL: string | undefined; if (this._hardwareInfo?.hardware.length) { - const boardData = this._hardwareInfo!.hardware[0]; + const boardData = this._hardwareInfo.hardware[0]; boardId = boardData.board.hassio_board_id; boardName = boardData.name; @@ -285,7 +285,7 @@ class HaConfigHardware extends SubscribeMixin(LitElement) { ` : ""} ${this._systemStatusData - ? html` + ? html`
${this.hass.localize(