From 1a28eac45fb94d4b05e2c8f09c61cb69b07d8ff2 Mon Sep 17 00:00:00 2001 From: Jan-Philipp Benecke Date: Wed, 11 Dec 2024 16:20:30 +0100 Subject: [PATCH] Move out of if --- .../config/automation/ha-automation-editor.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/panels/config/automation/ha-automation-editor.ts b/src/panels/config/automation/ha-automation-editor.ts index 6cc42b9b295d..f03d059530cf 100644 --- a/src/panels/config/automation/ha-automation-editor.ts +++ b/src/panels/config/automation/ha-automation-editor.ts @@ -861,15 +861,15 @@ export class HaAutomationEditor extends PreventUnsavedMixin( (entity: EntityRegistryEntry) => entity.unique_id === id ); entityId = automation?.entity_id; + } - if (entityId) { - await updateEntityRegistryEntry(this.hass, entityId, { - categories: { - automation: this._entityRegistryUpdate.category || "", - }, - labels: this._entityRegistryUpdate.labels || [], - }); - } + if (entityId) { + await updateEntityRegistryEntry(this.hass, entityId, { + categories: { + automation: this._entityRegistryUpdate.category || "", + }, + labels: this._entityRegistryUpdate.labels || [], + }); } }