Convert async_setup calls for auth sub-modules to callback functions (#115443)

This commit is contained in:
J. Nick Koston 2024-04-11 11:22:50 -10:00 committed by GitHub
parent c14f11fbf0
commit d9fc9f2e0c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 7 additions and 5 deletions

View file

@ -195,8 +195,8 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
websocket_api.async_register_command(hass, websocket_delete_all_refresh_tokens) websocket_api.async_register_command(hass, websocket_delete_all_refresh_tokens)
websocket_api.async_register_command(hass, websocket_sign_path) websocket_api.async_register_command(hass, websocket_sign_path)
await login_flow.async_setup(hass, store_result) login_flow.async_setup(hass, store_result)
await mfa_setup_flow.async_setup(hass) mfa_setup_flow.async_setup(hass)
return True return True

View file

@ -91,7 +91,7 @@ from homeassistant.components.http.ban import (
) )
from homeassistant.components.http.data_validator import RequestDataValidator from homeassistant.components.http.data_validator import RequestDataValidator
from homeassistant.components.http.view import HomeAssistantView from homeassistant.components.http.view import HomeAssistantView
from homeassistant.core import HomeAssistant from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers.network import is_cloud_connection from homeassistant.helpers.network import is_cloud_connection
from homeassistant.util.network import is_local from homeassistant.util.network import is_local
@ -105,7 +105,8 @@ if TYPE_CHECKING:
from . import StoreResultType from . import StoreResultType
async def async_setup( @callback
def async_setup(
hass: HomeAssistant, store_result: Callable[[str, Credentials], str] hass: HomeAssistant, store_result: Callable[[str, Credentials], str]
) -> None: ) -> None:
"""Component to allow users to login.""" """Component to allow users to login."""

View file

@ -62,7 +62,8 @@ class MfaFlowManager(data_entry_flow.FlowManager):
return result return result
async def async_setup(hass: HomeAssistant) -> None: @callback
def async_setup(hass: HomeAssistant) -> None:
"""Init mfa setup flow manager.""" """Init mfa setup flow manager."""
hass.data[DATA_SETUP_FLOW_MGR] = MfaFlowManager(hass) hass.data[DATA_SETUP_FLOW_MGR] = MfaFlowManager(hass)