Skip to content

Commit

Permalink
Create new clientsession for NYT Games (#127547)
Browse files Browse the repository at this point in the history
  • Loading branch information
joostlek authored and frenck committed Oct 4, 2024
1 parent ea8aa6b commit 6b814af
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions homeassistant/components/nyt_games/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CONF_TOKEN, Platform
from homeassistant.core import HomeAssistant
from homeassistant.helpers.aiohttp_client import async_get_clientsession
from homeassistant.helpers.aiohttp_client import async_create_clientsession

from .coordinator import NYTGamesCoordinator

Expand All @@ -23,7 +23,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: NYTGamesConfigEntry) ->
"""Set up NYTGames from a config entry."""

client = NYTGamesClient(
entry.data[CONF_TOKEN], session=async_get_clientsession(hass)
entry.data[CONF_TOKEN], session=async_create_clientsession(hass)
)

coordinator = NYTGamesCoordinator(hass, client)
Expand Down
4 changes: 2 additions & 2 deletions homeassistant/components/nyt_games/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

from homeassistant.config_entries import ConfigFlow, ConfigFlowResult
from homeassistant.const import CONF_TOKEN
from homeassistant.helpers.aiohttp_client import async_get_clientsession
from homeassistant.helpers.aiohttp_client import async_create_clientsession

from .const import DOMAIN, LOGGER

Expand All @@ -21,7 +21,7 @@ async def async_step_user(
"""Handle a flow initialized by the user."""
errors: dict[str, str] = {}
if user_input:
session = async_get_clientsession(self.hass)
session = async_create_clientsession(self.hass)
client = NYTGamesClient(user_input[CONF_TOKEN], session=session)
try:
user_id = await client.get_user_id()
Expand Down

0 comments on commit 6b814af

Please sign in to comment.