Pass hass clientsession to ring config flow (#125119)

Pass hass clientsession to ring config flow
This commit is contained in:
Steven B. 2024-09-03 13:00:30 +01:00 committed by GitHub
parent 94f458ff98
commit 5965d8d503
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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(