Adjust config-flow reauth type hints in components (#74088)

pull/73332/head^2
epenet 2022-06-28 08:43:06 +02:00 committed by GitHub
parent 530e1f9080
commit b6676df1cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 11 additions and 8 deletions

View File

@ -1,6 +1,7 @@
"""Config flow for Google integration."""
from __future__ import annotations
from collections.abc import Mapping
import logging
from typing import Any
@ -155,9 +156,7 @@ class OAuth2FlowHandler(
},
)
async def async_step_reauth(
self, user_input: dict[str, Any] | None = None
) -> FlowResult:
async def async_step_reauth(self, user_input: Mapping[str, Any]) -> FlowResult:
"""Perform reauth upon an API authentication error."""
self._reauth_config_entry = self.hass.config_entries.async_get_entry(
self.context["entry_id"]

View File

@ -1,8 +1,8 @@
"""Config flow for Neato Botvac."""
from __future__ import annotations
from collections.abc import Mapping
import logging
from types import MappingProxyType
from typing import Any
from homeassistant.config_entries import SOURCE_REAUTH
@ -35,7 +35,7 @@ class OAuth2FlowHandler(
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."""
return await self.async_step_reauth_confirm()

View File

@ -1,7 +1,9 @@
"""Config flow for Netatmo."""
from __future__ import annotations
from collections.abc import Mapping
import logging
from typing import Any
import uuid
import voluptuous as vol
@ -66,7 +68,7 @@ class NetatmoFlowHandler(
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."""
return await self.async_step_reauth_confirm()

View File

@ -1,6 +1,7 @@
"""Config flow for Spotify."""
from __future__ import annotations
from collections.abc import Mapping
import logging
from typing import Any
@ -56,7 +57,7 @@ class SpotifyFlowHandler(
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."""
self.reauth_entry = self.hass.config_entries.async_get_entry(
self.context["entry_id"]

View File

@ -1,6 +1,7 @@
"""Config flow for yolink."""
from __future__ import annotations
from collections.abc import Mapping
import logging
from typing import Any
@ -30,7 +31,7 @@ class OAuth2FlowHandler(
scopes = ["create"]
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."""
self._reauth_entry = self.hass.config_entries.async_get_entry(
self.context["entry_id"]