From e7d4f745ec15f7fc4e1158c999f1aa43ca9d2544 Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Fri, 25 Nov 2022 11:13:44 +0100 Subject: [PATCH] Expose config_entry and options as properties (#82691) Expose config_entry and options as a property --- homeassistant/config_entries.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/homeassistant/config_entries.py b/homeassistant/config_entries.py index fa37e9ffa1c..4956955cd21 100644 --- a/homeassistant/config_entries.py +++ b/homeassistant/config_entries.py @@ -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."""