From b4d62f23f4069224ca1a1884b4522f3faceec987 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Mon, 13 Oct 2025 10:59:33 -1000 Subject: [PATCH] Add support for next_flow on abort --- src/data/data_entry_flow.ts | 1 + src/dialogs/config-flow/dialog-data-entry-flow.ts | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/data/data_entry_flow.ts b/src/data/data_entry_flow.ts index 909c552d37..5a0aa7a66c 100644 --- a/src/data/data_entry_flow.ts +++ b/src/data/data_entry_flow.ts @@ -79,6 +79,7 @@ export interface DataEntryFlowStepAbort { reason: string; description_placeholders?: Record; translation_domain?: string; + next_flow?: [FlowType, string]; // [flow_type, flow_id] } export interface DataEntryFlowStepProgress { diff --git a/src/dialogs/config-flow/dialog-data-entry-flow.ts b/src/dialogs/config-flow/dialog-data-entry-flow.ts index 4831b94b03..f7b0e10e5b 100644 --- a/src/dialogs/config-flow/dialog-data-entry-flow.ts +++ b/src/dialogs/config-flow/dialog-data-entry-flow.ts @@ -472,7 +472,10 @@ class DataEntryFlowDialog extends LitElement { this._step = undefined; await this.updateComplete; this._step = _step; - if (_step.type === "create_entry" && _step.next_flow) { + if ( + (_step.type === "create_entry" || _step.type === "abort") && + _step.next_flow + ) { // skip device rename if there is a chained flow this._step = undefined; this._handler = undefined; @@ -486,7 +489,7 @@ class DataEntryFlowDialog extends LitElement { carryOverDevices: this._devices( this._params!.flowConfig.showDevices, Object.values(this.hass.devices), - _step.result?.entry_id, + _step.type === "create_entry" ? _step.result?.entry_id : undefined, this._params!.carryOverDevices ).map((device) => device.id), dialogClosedCallback: this._params!.dialogClosedCallback,