From 3fcdaa8a5db53908d2de4d8a6cf82187cb5d2629 Mon Sep 17 00:00:00 2001 From: Mick Vleeshouwer Date: Thu, 13 Jan 2022 12:35:07 -0800 Subject: [PATCH] Don't close HA aiohttp session in Overkiz Config Flow (#64052) --- .../components/overkiz/config_flow.py | 20 +++++++++---------- .../components/overkiz/manifest.json | 2 +- requirements_all.txt | 2 +- requirements_test_all.txt | 2 +- 4 files changed, 12 insertions(+), 14 deletions(-) diff --git a/homeassistant/components/overkiz/config_flow.py b/homeassistant/components/overkiz/config_flow.py index a8a99e4bd1b..005a930c682 100644 --- a/homeassistant/components/overkiz/config_flow.py +++ b/homeassistant/components/overkiz/config_flow.py @@ -38,18 +38,16 @@ class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN): server = SUPPORTED_SERVERS[user_input[CONF_HUB]] session = async_get_clientsession(self.hass) - async with OverkizClient( - username=username, - password=password, - server=server, - session=session, - ) as client: - await client.login() + client = OverkizClient( + username=username, password=password, server=server, session=session + ) - # Set first gateway as unique id - if gateways := await client.get_gateways(): - gateway_id = gateways[0].id - await self.async_set_unique_id(gateway_id) + await client.login() + + # Set first gateway id as unique id + if gateways := await client.get_gateways(): + gateway_id = gateways[0].id + await self.async_set_unique_id(gateway_id) async def async_step_user( self, user_input: dict[str, Any] | None = None diff --git a/homeassistant/components/overkiz/manifest.json b/homeassistant/components/overkiz/manifest.json index b9290dac8cd..13694f16c3e 100644 --- a/homeassistant/components/overkiz/manifest.json +++ b/homeassistant/components/overkiz/manifest.json @@ -4,7 +4,7 @@ "config_flow": true, "documentation": "https://www.home-assistant.io/integrations/overkiz", "requirements": [ - "pyoverkiz==1.1.0" + "pyoverkiz==1.1.1" ], "dhcp": [ { diff --git a/requirements_all.txt b/requirements_all.txt index 0e2035bda1f..67754d27cad 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -1740,7 +1740,7 @@ pyotgw==1.1b1 pyotp==2.6.0 # homeassistant.components.overkiz -pyoverkiz==1.1.0 +pyoverkiz==1.1.1 # homeassistant.components.openweathermap pyowm==3.2.0 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index 4dfc215f0b3..e05354f71c0 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -1097,7 +1097,7 @@ pyotgw==1.1b1 pyotp==2.6.0 # homeassistant.components.overkiz -pyoverkiz==1.1.0 +pyoverkiz==1.1.1 # homeassistant.components.openweathermap pyowm==3.2.0