mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 05:07:41 +00:00
Always create a new session in ConfigFlow in Overkiz integration (#66602)
This commit is contained in:
parent
5568531f74
commit
98ae7e106c
@ -19,7 +19,7 @@ from homeassistant.components import dhcp, zeroconf
|
|||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.const import CONF_PASSWORD, CONF_USERNAME
|
from homeassistant.const import CONF_PASSWORD, CONF_USERNAME
|
||||||
from homeassistant.data_entry_flow import FlowResult
|
from homeassistant.data_entry_flow import FlowResult
|
||||||
from homeassistant.helpers.aiohttp_client import async_get_clientsession
|
from homeassistant.helpers.aiohttp_client import async_create_clientsession
|
||||||
|
|
||||||
from .const import CONF_HUB, DEFAULT_HUB, DOMAIN, LOGGER
|
from .const import CONF_HUB, DEFAULT_HUB, DOMAIN, LOGGER
|
||||||
|
|
||||||
@ -46,12 +46,11 @@ class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
|
|||||||
username = user_input[CONF_USERNAME]
|
username = user_input[CONF_USERNAME]
|
||||||
password = user_input[CONF_PASSWORD]
|
password = user_input[CONF_PASSWORD]
|
||||||
server = SUPPORTED_SERVERS[user_input[CONF_HUB]]
|
server = SUPPORTED_SERVERS[user_input[CONF_HUB]]
|
||||||
session = async_get_clientsession(self.hass)
|
session = async_create_clientsession(self.hass)
|
||||||
|
|
||||||
client = OverkizClient(
|
async with OverkizClient(
|
||||||
username=username, password=password, server=server, session=session
|
username=username, password=password, server=server, session=session
|
||||||
)
|
) as client:
|
||||||
|
|
||||||
await client.login()
|
await client.login()
|
||||||
|
|
||||||
# Set first gateway id as unique id
|
# Set first gateway id as unique id
|
||||||
|
Loading…
x
Reference in New Issue
Block a user