Skip to content

Commit 3b04785

Browse files
zweckjfrenck
authored andcommitted
Create own clientsession for lamarzocco (home-assistant#148385)
1 parent 91cdf1a commit 3b04785

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

homeassistant/components/lamarzocco/__init__.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
from homeassistant.core import HomeAssistant
2424
from homeassistant.exceptions import ConfigEntryAuthFailed, ConfigEntryNotReady
2525
from homeassistant.helpers import issue_registry as ir
26-
from homeassistant.helpers.aiohttp_client import async_get_clientsession
26+
from homeassistant.helpers.aiohttp_client import async_create_clientsession
2727

2828
from .const import CONF_USE_BLUETOOTH, DOMAIN
2929
from .coordinator import (
@@ -57,11 +57,10 @@ async def async_setup_entry(hass: HomeAssistant, entry: LaMarzoccoConfigEntry) -
5757
assert entry.unique_id
5858
serial = entry.unique_id
5959

60-
client = async_get_clientsession(hass)
6160
cloud_client = LaMarzoccoCloudClient(
6261
username=entry.data[CONF_USERNAME],
6362
password=entry.data[CONF_PASSWORD],
64-
client=client,
63+
client=async_create_clientsession(hass),
6564
)
6665

6766
try:

homeassistant/components/lamarzocco/config_flow.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
)
3434
from homeassistant.core import callback
3535
from homeassistant.helpers import config_validation as cv
36-
from homeassistant.helpers.aiohttp_client import async_get_clientsession
36+
from homeassistant.helpers.aiohttp_client import async_create_clientsession
3737
from homeassistant.helpers.selector import (
3838
SelectOptionDict,
3939
SelectSelector,
@@ -83,7 +83,7 @@ async def async_step_user(
8383
**user_input,
8484
}
8585

86-
self._client = async_get_clientsession(self.hass)
86+
self._client = async_create_clientsession(self.hass)
8787
cloud_client = LaMarzoccoCloudClient(
8888
username=data[CONF_USERNAME],
8989
password=data[CONF_PASSWORD],

0 commit comments

Comments
 (0)