Switch to common clientsession for lamarzocco (#144137)

This commit is contained in:
Josef Zweck 2025-05-03 14:44:18 +02:00 committed by GitHub
parent 64b7f2c285
commit a2bc3e3908
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 4 deletions

View File

@ -23,7 +23,7 @@ from homeassistant.const import (
from homeassistant.core import HomeAssistant from homeassistant.core import HomeAssistant
from homeassistant.exceptions import ConfigEntryAuthFailed, ConfigEntryNotReady from homeassistant.exceptions import ConfigEntryAuthFailed, ConfigEntryNotReady
from homeassistant.helpers import issue_registry as ir from homeassistant.helpers import issue_registry as ir
from homeassistant.helpers.aiohttp_client import async_create_clientsession from homeassistant.helpers.aiohttp_client import async_get_clientsession
from .const import CONF_USE_BLUETOOTH, DOMAIN from .const import CONF_USE_BLUETOOTH, DOMAIN
from .coordinator import ( from .coordinator import (
@ -57,7 +57,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: LaMarzoccoConfigEntry) -
assert entry.unique_id assert entry.unique_id
serial = entry.unique_id serial = entry.unique_id
client = async_create_clientsession(hass) client = async_get_clientsession(hass)
cloud_client = LaMarzoccoCloudClient( cloud_client = LaMarzoccoCloudClient(
username=entry.data[CONF_USERNAME], username=entry.data[CONF_USERNAME],
password=entry.data[CONF_PASSWORD], password=entry.data[CONF_PASSWORD],

View File

@ -33,7 +33,7 @@ from homeassistant.const import (
) )
from homeassistant.core import callback from homeassistant.core import callback
from homeassistant.helpers import config_validation as cv from homeassistant.helpers import config_validation as cv
from homeassistant.helpers.aiohttp_client import async_create_clientsession from homeassistant.helpers.aiohttp_client import async_get_clientsession
from homeassistant.helpers.selector import ( from homeassistant.helpers.selector import (
SelectOptionDict, SelectOptionDict,
SelectSelector, SelectSelector,
@ -83,7 +83,7 @@ class LmConfigFlow(ConfigFlow, domain=DOMAIN):
**user_input, **user_input,
} }
self._client = async_create_clientsession(self.hass) self._client = async_get_clientsession(self.hass)
cloud_client = LaMarzoccoCloudClient( cloud_client = LaMarzoccoCloudClient(
username=data[CONF_USERNAME], username=data[CONF_USERNAME],
password=data[CONF_PASSWORD], password=data[CONF_PASSWORD],