Compare commits

...

2 Commits

Author SHA1 Message Date
Joost Lekkerkerker
9c7397fc32 Update test_sensor.py 2025-06-28 10:47:23 +02:00
Joost Lekkerkerker
581fd34264 Create new clientsession instead of using the shared session 2025-06-28 10:32:53 +02:00
2 changed files with 3 additions and 3 deletions

View File

@@ -11,7 +11,7 @@ import xmltodict
from homeassistant.core import HomeAssistant
from homeassistant.helpers import template
from homeassistant.helpers.aiohttp_client import async_get_clientsession
from homeassistant.helpers.aiohttp_client import async_create_clientsession
from homeassistant.helpers.json import json_dumps
from homeassistant.util.ssl import SSLCipherList
@@ -94,7 +94,7 @@ class RestData:
async def async_update(self, log_errors: bool = True) -> None:
"""Get the latest data from REST service with provided method."""
if not self._session:
self._session = async_get_clientsession(
self._session = async_create_clientsession(
self._hass,
verify_ssl=self._verify_ssl,
ssl_cipher=self._ssl_cipher_list,

View File

@@ -178,7 +178,7 @@ async def test_setup_ssl_ciphers(
) -> None:
"""Test setup with minimum configuration."""
with patch(
"homeassistant.components.rest.data.async_get_clientsession",
"homeassistant.components.rest.data.async_create_clientsession",
return_value=aioclient_mock,
) as aiohttp_client:
assert await async_setup_component(