mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 05:07:41 +00:00
Adjust config-flow reauth type hints in components (#74088)
This commit is contained in:
parent
530e1f9080
commit
b6676df1cb
@ -1,6 +1,7 @@
|
|||||||
"""Config flow for Google integration."""
|
"""Config flow for Google integration."""
|
||||||
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
|
||||||
|
|
||||||
@ -155,9 +156,7 @@ class OAuth2FlowHandler(
|
|||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
async def async_step_reauth(
|
async def async_step_reauth(self, user_input: Mapping[str, Any]) -> FlowResult:
|
||||||
self, user_input: dict[str, Any] | None = None
|
|
||||||
) -> FlowResult:
|
|
||||||
"""Perform reauth upon an API authentication error."""
|
"""Perform reauth upon an API authentication error."""
|
||||||
self._reauth_config_entry = self.hass.config_entries.async_get_entry(
|
self._reauth_config_entry = self.hass.config_entries.async_get_entry(
|
||||||
self.context["entry_id"]
|
self.context["entry_id"]
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
"""Config flow for Neato Botvac."""
|
"""Config flow for Neato Botvac."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from collections.abc import Mapping
|
||||||
import logging
|
import logging
|
||||||
from types import MappingProxyType
|
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
from homeassistant.config_entries import SOURCE_REAUTH
|
from homeassistant.config_entries import SOURCE_REAUTH
|
||||||
@ -35,7 +35,7 @@ class OAuth2FlowHandler(
|
|||||||
|
|
||||||
return await super().async_step_user(user_input=user_input)
|
return await super().async_step_user(user_input=user_input)
|
||||||
|
|
||||||
async def async_step_reauth(self, data: MappingProxyType[str, Any]) -> FlowResult:
|
async def async_step_reauth(self, data: Mapping[str, Any]) -> FlowResult:
|
||||||
"""Perform reauth upon migration of old entries."""
|
"""Perform reauth upon migration of old entries."""
|
||||||
return await self.async_step_reauth_confirm()
|
return await self.async_step_reauth_confirm()
|
||||||
|
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
"""Config flow for Netatmo."""
|
"""Config flow for Netatmo."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from collections.abc import Mapping
|
||||||
import logging
|
import logging
|
||||||
|
from typing import Any
|
||||||
import uuid
|
import uuid
|
||||||
|
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
@ -66,7 +68,7 @@ class NetatmoFlowHandler(
|
|||||||
|
|
||||||
return await super().async_step_user(user_input)
|
return await super().async_step_user(user_input)
|
||||||
|
|
||||||
async def async_step_reauth(self, user_input: dict | None = None) -> FlowResult:
|
async def async_step_reauth(self, user_input: Mapping[str, Any]) -> FlowResult:
|
||||||
"""Perform reauth upon an API authentication error."""
|
"""Perform reauth upon an API authentication error."""
|
||||||
return await self.async_step_reauth_confirm()
|
return await self.async_step_reauth_confirm()
|
||||||
|
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
"""Config flow for Spotify."""
|
"""Config flow for Spotify."""
|
||||||
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
|
||||||
|
|
||||||
@ -56,7 +57,7 @@ class SpotifyFlowHandler(
|
|||||||
|
|
||||||
return self.async_create_entry(title=name, data=data)
|
return self.async_create_entry(title=name, data=data)
|
||||||
|
|
||||||
async def async_step_reauth(self, entry: dict[str, Any]) -> FlowResult:
|
async def async_step_reauth(self, entry: Mapping[str, Any]) -> FlowResult:
|
||||||
"""Perform reauth upon migration of old entries."""
|
"""Perform reauth upon migration of old entries."""
|
||||||
self.reauth_entry = self.hass.config_entries.async_get_entry(
|
self.reauth_entry = self.hass.config_entries.async_get_entry(
|
||||||
self.context["entry_id"]
|
self.context["entry_id"]
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
"""Config flow for yolink."""
|
"""Config flow for yolink."""
|
||||||
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
|
||||||
|
|
||||||
@ -30,7 +31,7 @@ class OAuth2FlowHandler(
|
|||||||
scopes = ["create"]
|
scopes = ["create"]
|
||||||
return {"scope": " ".join(scopes)}
|
return {"scope": " ".join(scopes)}
|
||||||
|
|
||||||
async def async_step_reauth(self, user_input=None) -> FlowResult:
|
async def async_step_reauth(self, user_input: Mapping[str, Any]) -> FlowResult:
|
||||||
"""Perform reauth upon an API authentication error."""
|
"""Perform reauth upon an API authentication error."""
|
||||||
self._reauth_entry = self.hass.config_entries.async_get_entry(
|
self._reauth_entry = self.hass.config_entries.async_get_entry(
|
||||||
self.context["entry_id"]
|
self.context["entry_id"]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user