Convert async_setup calls for auth sub-modules to callback functions (#115443)
This commit is contained in:
parent
c14f11fbf0
commit
d9fc9f2e0c
3 changed files with 7 additions and 5 deletions
|
@ -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
|
||||||
|
|
||||||
|
|
|
@ -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."""
|
||||||
|
|
|
@ -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)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue