mirror of
https://github.com/home-assistant/core.git
synced 2025-07-17 10:17:09 +00:00
Improve type hints in config_flow reconfigure step (#127224)
This commit is contained in:
parent
905ac20205
commit
46405d7738
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from collections.abc import Mapping
|
||||||
from typing import TYPE_CHECKING, Any
|
from typing import TYPE_CHECKING, Any
|
||||||
|
|
||||||
from brother import Brother, SnmpError, UnsupportedModelError
|
from brother import Brother, SnmpError, UnsupportedModelError
|
||||||
@ -141,7 +142,7 @@ class BrotherConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
)
|
)
|
||||||
|
|
||||||
async def async_step_reconfigure(
|
async def async_step_reconfigure(
|
||||||
self, _: dict[str, Any] | None = None
|
self, entry_data: Mapping[str, Any]
|
||||||
) -> ConfigFlowResult:
|
) -> ConfigFlowResult:
|
||||||
"""Handle a reconfiguration flow initialized by the user."""
|
"""Handle a reconfiguration flow initialized by the user."""
|
||||||
entry = self.hass.config_entries.async_get_entry(self.context["entry_id"])
|
entry = self.hass.config_entries.async_get_entry(self.context["entry_id"])
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from collections.abc import Mapping
|
||||||
import logging
|
import logging
|
||||||
from typing import TYPE_CHECKING, Any
|
from typing import TYPE_CHECKING, Any
|
||||||
import urllib.error
|
import urllib.error
|
||||||
@ -121,7 +122,7 @@ class FeedReaderConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
return await self.async_step_user({CONF_URL: import_data[CONF_URL]})
|
return await self.async_step_user({CONF_URL: import_data[CONF_URL]})
|
||||||
|
|
||||||
async def async_step_reconfigure(
|
async def async_step_reconfigure(
|
||||||
self, _: dict[str, Any] | None = None
|
self, entry_data: Mapping[str, Any]
|
||||||
) -> ConfigFlowResult:
|
) -> ConfigFlowResult:
|
||||||
"""Handle a reconfiguration flow initialized by the user."""
|
"""Handle a reconfiguration flow initialized by the user."""
|
||||||
config_entry = self.hass.config_entries.async_get_entry(
|
config_entry = self.hass.config_entries.async_get_entry(
|
||||||
|
@ -335,7 +335,9 @@ class FritzBoxToolsFlowHandler(ConfigFlow, domain=DOMAIN):
|
|||||||
await self.hass.config_entries.async_reload(self._entry.entry_id)
|
await self.hass.config_entries.async_reload(self._entry.entry_id)
|
||||||
return self.async_abort(reason="reauth_successful")
|
return self.async_abort(reason="reauth_successful")
|
||||||
|
|
||||||
async def async_step_reconfigure(self, _: Mapping[str, Any]) -> ConfigFlowResult:
|
async def async_step_reconfigure(
|
||||||
|
self, entry_data: Mapping[str, Any]
|
||||||
|
) -> ConfigFlowResult:
|
||||||
"""Handle reconfigure flow ."""
|
"""Handle reconfigure flow ."""
|
||||||
self._entry = self.hass.config_entries.async_get_entry(self.context["entry_id"])
|
self._entry = self.hass.config_entries.async_get_entry(self.context["entry_id"])
|
||||||
assert self._entry
|
assert self._entry
|
||||||
|
@ -225,7 +225,7 @@ class FritzboxConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
)
|
)
|
||||||
|
|
||||||
async def async_step_reconfigure(
|
async def async_step_reconfigure(
|
||||||
self, _: dict[str, Any] | None = None
|
self, entry_data: Mapping[str, Any]
|
||||||
) -> ConfigFlowResult:
|
) -> ConfigFlowResult:
|
||||||
"""Handle a reconfiguration flow initialized by the user."""
|
"""Handle a reconfiguration flow initialized by the user."""
|
||||||
entry = self.hass.config_entries.async_get_entry(self.context["entry_id"])
|
entry = self.hass.config_entries.async_get_entry(self.context["entry_id"])
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from collections.abc import Mapping
|
||||||
import logging
|
import logging
|
||||||
from typing import TYPE_CHECKING, Any
|
from typing import TYPE_CHECKING, Any
|
||||||
|
|
||||||
@ -141,7 +142,7 @@ class HERETravelTimeConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
)
|
)
|
||||||
|
|
||||||
async def async_step_reconfigure(
|
async def async_step_reconfigure(
|
||||||
self, _: dict[str, Any] | None = None
|
self, entry_data: Mapping[str, Any]
|
||||||
) -> ConfigFlowResult:
|
) -> ConfigFlowResult:
|
||||||
"""Handle reconfiguration."""
|
"""Handle reconfiguration."""
|
||||||
self._is_reconfigure_flow = True
|
self._is_reconfigure_flow = True
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from collections.abc import Mapping
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
from babel import Locale, UnknownLocaleError
|
from babel import Locale, UnknownLocaleError
|
||||||
@ -112,7 +113,7 @@ class HolidayConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
return self.async_show_form(step_id="province", data_schema=province_schema)
|
return self.async_show_form(step_id="province", data_schema=province_schema)
|
||||||
|
|
||||||
async def async_step_reconfigure(
|
async def async_step_reconfigure(
|
||||||
self, user_input: dict[str, Any] | None = None
|
self, entry_data: Mapping[str, Any]
|
||||||
) -> ConfigFlowResult:
|
) -> ConfigFlowResult:
|
||||||
"""Handle the re-configuration of a province."""
|
"""Handle the re-configuration of a province."""
|
||||||
self.config_entry = self.hass.config_entries.async_get_entry(
|
self.config_entry = self.hass.config_entries.async_get_entry(
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from collections.abc import Mapping
|
||||||
import logging
|
import logging
|
||||||
from typing import TYPE_CHECKING, Any
|
from typing import TYPE_CHECKING, Any
|
||||||
import zoneinfo
|
import zoneinfo
|
||||||
@ -130,7 +131,7 @@ class JewishCalendarConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
return await self.async_step_user(import_data)
|
return await self.async_step_user(import_data)
|
||||||
|
|
||||||
async def async_step_reconfigure(
|
async def async_step_reconfigure(
|
||||||
self, _: dict[str, Any] | None = None
|
self, entry_data: Mapping[str, Any]
|
||||||
) -> ConfigFlowResult:
|
) -> ConfigFlowResult:
|
||||||
"""Handle a reconfiguration flow initialized by the user."""
|
"""Handle a reconfiguration flow initialized by the user."""
|
||||||
config_entry = self.hass.config_entries.async_get_entry(
|
config_entry = self.hass.config_entries.async_get_entry(
|
||||||
|
@ -119,7 +119,7 @@ class MealieConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
)
|
)
|
||||||
|
|
||||||
async def async_step_reconfigure(
|
async def async_step_reconfigure(
|
||||||
self, user_input: dict[str, Any] | None = None
|
self, entry_data: Mapping[str, Any]
|
||||||
) -> ConfigFlowResult:
|
) -> ConfigFlowResult:
|
||||||
"""Handle reconfiguration of the integration."""
|
"""Handle reconfiguration of the integration."""
|
||||||
self.entry = self.hass.config_entries.async_get_entry(self.context["entry_id"])
|
self.entry = self.hass.config_entries.async_get_entry(self.context["entry_id"])
|
||||||
|
@ -149,7 +149,7 @@ class FlowHandler(ConfigFlow, domain=DOMAIN):
|
|||||||
return acquired_token, errors
|
return acquired_token, errors
|
||||||
|
|
||||||
async def async_step_reconfigure(
|
async def async_step_reconfigure(
|
||||||
self, user_input: dict[str, Any] | None = None
|
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.entry = self.hass.config_entries.async_get_entry(self.context["entry_id"])
|
self.entry = self.hass.config_entries.async_get_entry(self.context["entry_id"])
|
||||||
|
@ -226,7 +226,7 @@ class NAMFlowHandler(ConfigFlow, domain=DOMAIN):
|
|||||||
)
|
)
|
||||||
|
|
||||||
async def async_step_reconfigure(
|
async def async_step_reconfigure(
|
||||||
self, _: dict[str, Any] | None = None
|
self, entry_data: Mapping[str, Any]
|
||||||
) -> ConfigFlowResult:
|
) -> ConfigFlowResult:
|
||||||
"""Handle a reconfiguration flow initialized by the user."""
|
"""Handle a reconfiguration flow initialized by the user."""
|
||||||
entry = self.hass.config_entries.async_get_entry(self.context["entry_id"])
|
entry = self.hass.config_entries.async_get_entry(self.context["entry_id"])
|
||||||
|
@ -400,7 +400,7 @@ class ShellyConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
)
|
)
|
||||||
|
|
||||||
async def async_step_reconfigure(
|
async def async_step_reconfigure(
|
||||||
self, _: dict[str, Any] | None = None
|
self, entry_data: Mapping[str, Any]
|
||||||
) -> ConfigFlowResult:
|
) -> ConfigFlowResult:
|
||||||
"""Handle a reconfiguration flow initialized by the user."""
|
"""Handle a reconfiguration flow initialized by the user."""
|
||||||
entry = self.hass.config_entries.async_get_entry(self.context["entry_id"])
|
entry = self.hass.config_entries.async_get_entry(self.context["entry_id"])
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from collections.abc import Mapping
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
from smhi.smhi_lib import Smhi, SmhiForecastException
|
from smhi.smhi_lib import Smhi, SmhiForecastException
|
||||||
@ -82,7 +83,7 @@ class SmhiFlowHandler(ConfigFlow, domain=DOMAIN):
|
|||||||
)
|
)
|
||||||
|
|
||||||
async def async_step_reconfigure(
|
async def async_step_reconfigure(
|
||||||
self, user_input: dict[str, Any] | None = None
|
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.hass.config_entries.async_get_entry(
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from collections.abc import Mapping
|
||||||
import logging
|
import logging
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
@ -117,7 +118,7 @@ class TadoConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
return await self.async_step_user()
|
return await self.async_step_user()
|
||||||
|
|
||||||
async def async_step_reconfigure(
|
async def async_step_reconfigure(
|
||||||
self, user_input: dict[str, Any] | None = None
|
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.hass.config_entries.async_get_entry(
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from collections.abc import Mapping
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
@ -192,7 +193,7 @@ class WazeConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
)
|
)
|
||||||
|
|
||||||
async def async_step_reconfigure(
|
async def async_step_reconfigure(
|
||||||
self, _: dict[str, Any] | None = None
|
self, entry_data: Mapping[str, Any]
|
||||||
) -> ConfigFlowResult:
|
) -> ConfigFlowResult:
|
||||||
"""Handle reconfiguration."""
|
"""Handle reconfiguration."""
|
||||||
self._entry = self.hass.config_entries.async_get_entry(self.context["entry_id"])
|
self._entry = self.hass.config_entries.async_get_entry(self.context["entry_id"])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user