mirror of
https://github.com/home-assistant/core.git
synced 2025-08-03 04:35:11 +02:00
Cleanup deprecated OptionsFlowWithConfigEntry (part 3) (#129756)
This commit is contained in:
@@ -3127,6 +3127,10 @@ class OptionsFlow(ConfigEntryBaseFlow):
|
||||
)
|
||||
self._config_entry = value
|
||||
|
||||
def initialize_options(self, config_entry: ConfigEntry) -> None:
|
||||
"""Initialize the options to a mutable copy of the config entry options."""
|
||||
self._options = deepcopy(dict(config_entry.options))
|
||||
|
||||
@property
|
||||
def options(self) -> dict[str, Any]:
|
||||
"""Return a mutable copy of the config entry options.
|
||||
@@ -3135,7 +3139,7 @@ class OptionsFlow(ConfigEntryBaseFlow):
|
||||
can only be referenced after initialisation.
|
||||
"""
|
||||
if not hasattr(self, "_options"):
|
||||
self._options = deepcopy(dict(self.config_entry.options))
|
||||
self.initialize_options(self.config_entry)
|
||||
return self._options
|
||||
|
||||
@options.setter
|
||||
@@ -3161,7 +3165,7 @@ class OptionsFlowWithConfigEntry(OptionsFlow):
|
||||
"inherits from OptionsFlowWithConfigEntry, which is deprecated "
|
||||
"and will stop working in 2025.12",
|
||||
error_if_integration=False,
|
||||
error_if_core=False,
|
||||
error_if_core=True,
|
||||
)
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user