Add support for next_flow on abort

This commit is contained in:
J. Nick Koston
2025-10-13 10:59:33 -10:00
parent 9eb5360a68
commit b4d62f23f4
2 changed files with 6 additions and 2 deletions

View File

@@ -79,6 +79,7 @@ export interface DataEntryFlowStepAbort {
reason: string;
description_placeholders?: Record<string, string>;
translation_domain?: string;
next_flow?: [FlowType, string]; // [flow_type, flow_id]
}
export interface DataEntryFlowStepProgress {

View File

@@ -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,