Add OptionsFlow helpers to get the current config entry#129562
Conversation
|
Hey there @asymworks, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
|
I also think maybe this PR can initiate the deprecation of |
Before we initiate the deprecation, we'll need to have a replacement also for the That is not as often used, and I would prefer to do that in a follow-up PR. |
…`__init__` method
Breaking change
For developpers only: assigning a value to
self.config_entryin an option flow is deprecated, and will stop working in 2025.12.Please use the read-only property instead.
Proposed change
Add
self._config_entry_idandself.config_entryproperties toOptionsFlowMost option flows use
OptionsFlowWithConfigEntryfor the sole purpose of gaining access ot the config entry, without realising it's available already viaself.handlerAs a follow-up, when we have considered the mutable
optionsproperty and all integrations have been updated, we should be able to deprecate/remove theOptionsFlowWithConfigEntrycc @MartinHjelmare / @gjohansson-ST
Needs:
Type of change
Additional information
Checklist
ruff format homeassistant tests)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest.requirements_all.txt.Updated by running
python3 -m script.gen_requirements_all.To help with the load of incoming pull requests: