Expose config_entry and options as properties (#82691)
Expose config_entry and options as a property
This commit is contained in:
parent
ea1868b7b9
commit
e7d4f745ec
1 changed files with 11 additions and 1 deletions
|
@ -1683,9 +1683,19 @@ class OptionsFlowWithConfigEntry(OptionsFlow):
|
|||
|
||||
def __init__(self, config_entry: ConfigEntry) -> None:
|
||||
"""Initialize options flow."""
|
||||
self.config_entry = config_entry
|
||||
self._config_entry = config_entry
|
||||
self._options = deepcopy(dict(config_entry.options))
|
||||
|
||||
@property
|
||||
def config_entry(self) -> ConfigEntry:
|
||||
"""Return the config entry."""
|
||||
return self._config_entry
|
||||
|
||||
@property
|
||||
def options(self) -> dict[str, Any]:
|
||||
"""Return a mutable copy of the config entry options."""
|
||||
return self._options
|
||||
|
||||
|
||||
class EntityRegistryDisabledHandler:
|
||||
"""Handler to handle when entities related to config entries updating disabled_by."""
|
||||
|
|
Loading…
Add table
Reference in a new issue