Pass hass clientsession to ring config flow (#125119)
Pass hass clientsession to ring config flow
This commit is contained in:
parent
94f458ff98
commit
5965d8d503
1 changed files with 5 additions and 1 deletions
|
@ -17,6 +17,7 @@ from homeassistant.const import (
|
||||||
)
|
)
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.exceptions import HomeAssistantError
|
from homeassistant.exceptions import HomeAssistantError
|
||||||
|
from homeassistant.helpers.aiohttp_client import async_get_clientsession
|
||||||
|
|
||||||
from .const import CONF_2FA, DOMAIN
|
from .const import CONF_2FA, DOMAIN
|
||||||
|
|
||||||
|
@ -31,7 +32,10 @@ STEP_REAUTH_DATA_SCHEMA = vol.Schema({vol.Required(CONF_PASSWORD): str})
|
||||||
async def validate_input(hass: HomeAssistant, data: dict[str, str]) -> dict[str, Any]:
|
async def validate_input(hass: HomeAssistant, data: dict[str, str]) -> dict[str, Any]:
|
||||||
"""Validate the user input allows us to connect."""
|
"""Validate the user input allows us to connect."""
|
||||||
|
|
||||||
auth = Auth(f"{APPLICATION_NAME}/{ha_version}")
|
auth = Auth(
|
||||||
|
f"{APPLICATION_NAME}/{ha_version}",
|
||||||
|
http_client_session=async_get_clientsession(hass),
|
||||||
|
)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
token = await auth.async_fetch_token(
|
token = await auth.async_fetch_token(
|
||||||
|
|
Loading…
Add table
Reference in a new issue