From f9d73eebfbb7d26bc490ea667d917e121834ec70 Mon Sep 17 00:00:00 2001 From: Erik Montnemery Date: Sat, 13 Jan 2024 11:55:56 +0100 Subject: [PATCH] Add blog post about changes to `FlowHandler.async_show_progress` (#2038) * Add blog post about changes to FlowHandler.async_show_progress * Update 2024-01-11-async-show-progress-changes.md --- .../2024-01-11-async-show-progress-changes.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 blog/2024-01-11-async-show-progress-changes.md diff --git a/blog/2024-01-11-async-show-progress-changes.md b/blog/2024-01-11-async-show-progress-changes.md new file mode 100644 index 00000000..ae895f08 --- /dev/null +++ b/blog/2024-01-11-async-show-progress-changes.md @@ -0,0 +1,19 @@ +--- +author: Erik Montnémery +authorURL: https://github.com/emontnemery +title: "Changes to FlowManager.async_show_progress" +--- + +`FlowHandler.async_show_progress` has been updated: +- The `step_id` parameter is deprecated and will be removed in Home Assistant core release 2024.8 +- A new argument `progress_task` has been added, which will be mandatory in Home Assistant core release 2024.8 + +If `progress_task` is passed, `FlowManager` will: +- Send an event to fronted once the task has finished +- Cancel the `progress_task` if the user closes the config flow dialog before the task is done + +This means derived classes are no longer responsible for interaction between the progress task state and the UI. + +`FlowHandler.async_show_progress` will log a warning if it's called without a `progress_task`. In Home Assistant core release 2024.8, the call will instead fail. + +More details can be found in the [documentation](/docs/data_entry_flow_index/#show-progress--show-progress-done) and in [core PR #107668](https://github.com/home-assistant/core/pull/107668) and ["107802](https://github.com/home-assistant/core/pull/107802).