Skip to content
Snippets Groups Projects
Unverified Commit d0d8de94 authored by epenet's avatar epenet Committed by GitHub
Browse files

Use _get_reconfigure_entry in tado (#127311)

parent 4974202b
No related branches found
No related tags found
No related merge requests found
...@@ -74,7 +74,7 @@ class TadoConfigFlow(ConfigFlow, domain=DOMAIN): ...@@ -74,7 +74,7 @@ class TadoConfigFlow(ConfigFlow, domain=DOMAIN):
"""Handle a config flow for Tado.""" """Handle a config flow for Tado."""
VERSION = 1 VERSION = 1
config_entry: ConfigEntry | None config_entry: ConfigEntry
async def async_step_user( async def async_step_user(
self, user_input: dict[str, Any] | None = None self, user_input: dict[str, Any] | None = None
...@@ -121,9 +121,7 @@ class TadoConfigFlow(ConfigFlow, domain=DOMAIN): ...@@ -121,9 +121,7 @@ class TadoConfigFlow(ConfigFlow, domain=DOMAIN):
self, entry_data: Mapping[str, Any] self, entry_data: Mapping[str, Any]
) -> ConfigFlowResult: ) -> ConfigFlowResult:
"""Handle a reconfiguration flow initialized by the user.""" """Handle a reconfiguration flow initialized by the user."""
self.config_entry = self.hass.config_entries.async_get_entry( self.config_entry = self._get_reconfigure_entry()
self.context["entry_id"]
)
return await self.async_step_reconfigure_confirm() return await self.async_step_reconfigure_confirm()
async def async_step_reconfigure_confirm( async def async_step_reconfigure_confirm(
...@@ -131,7 +129,6 @@ class TadoConfigFlow(ConfigFlow, domain=DOMAIN): ...@@ -131,7 +129,6 @@ class TadoConfigFlow(ConfigFlow, domain=DOMAIN):
) -> ConfigFlowResult: ) -> ConfigFlowResult:
"""Handle a reconfiguration flow initialized by the user.""" """Handle a reconfiguration flow initialized by the user."""
errors: dict[str, str] = {} errors: dict[str, str] = {}
assert self.config_entry
if user_input is not None: if user_input is not None:
user_input[CONF_USERNAME] = self.config_entry.data[CONF_USERNAME] user_input[CONF_USERNAME] = self.config_entry.data[CONF_USERNAME]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment