Use _get_reauth_entry in comelit config flow (#127386)

This commit is contained in:
epenet 2024-10-03 09:31:44 +02:00 committed by GitHub
parent 04860ae1d2
commit 609d410e6a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -68,7 +68,7 @@ class ComelitConfigFlow(ConfigFlow, domain=DOMAIN):
"""Handle a config flow for Comelit."""
VERSION = 1
_reauth_entry: ConfigEntry | None
_reauth_entry: ConfigEntry
_reauth_host: str
_reauth_port: int
_reauth_type: str
@ -106,9 +106,7 @@ class ComelitConfigFlow(ConfigFlow, domain=DOMAIN):
self, entry_data: Mapping[str, Any]
) -> ConfigFlowResult:
"""Handle reauth flow."""
self._reauth_entry = self.hass.config_entries.async_get_entry(
self.context["entry_id"]
)
self._reauth_entry = self._get_reauth_entry()
self._reauth_host = entry_data[CONF_HOST]
self._reauth_port = entry_data.get(CONF_PORT, DEFAULT_PORT)
self._reauth_type = entry_data.get(CONF_TYPE, BRIDGE)
@ -120,7 +118,6 @@ class ComelitConfigFlow(ConfigFlow, domain=DOMAIN):
self, user_input: dict[str, Any] | None = None
) -> ConfigFlowResult:
"""Handle reauth confirm."""
assert self._reauth_entry
errors = {}
if user_input is not None: