diff --git a/homeassistant/components/opower/config_flow.py b/homeassistant/components/opower/config_flow.py index 6396ba24a15..4753a77894e 100644 --- a/homeassistant/components/opower/config_flow.py +++ b/homeassistant/components/opower/config_flow.py @@ -10,6 +10,7 @@ from opower import ( CannotConnect, InvalidAuth, Opower, + create_cookie_jar, get_supported_utility_names, select_utility, ) @@ -39,7 +40,7 @@ async def _validate_login( ) -> dict[str, str]: """Validate login data and return any errors.""" api = Opower( - async_create_clientsession(hass), + async_create_clientsession(hass, cookie_jar=create_cookie_jar()), login_data[CONF_UTILITY], login_data[CONF_USERNAME], login_data[CONF_PASSWORD], diff --git a/homeassistant/components/opower/coordinator.py b/homeassistant/components/opower/coordinator.py index d03c30b7db0..189fa185cd1 100644 --- a/homeassistant/components/opower/coordinator.py +++ b/homeassistant/components/opower/coordinator.py @@ -12,6 +12,7 @@ from opower import ( MeterType, Opower, ReadResolution, + create_cookie_jar, ) from opower.exceptions import ApiException, CannotConnect, InvalidAuth @@ -30,7 +31,8 @@ from homeassistant.config_entries import ConfigEntry from homeassistant.const import CONF_PASSWORD, CONF_USERNAME, UnitOfEnergy, UnitOfVolume from homeassistant.core import HomeAssistant, callback from homeassistant.exceptions import ConfigEntryAuthFailed -from homeassistant.helpers import aiohttp_client, issue_registry as ir +from homeassistant.helpers import issue_registry as ir +from homeassistant.helpers.aiohttp_client import async_create_clientsession from homeassistant.helpers.update_coordinator import DataUpdateCoordinator, UpdateFailed from homeassistant.util import dt as dt_util @@ -62,7 +64,7 @@ class OpowerCoordinator(DataUpdateCoordinator[dict[str, Forecast]]): update_interval=timedelta(hours=12), ) self.api = Opower( - aiohttp_client.async_get_clientsession(hass), + async_create_clientsession(hass, cookie_jar=create_cookie_jar()), config_entry.data[CONF_UTILITY], config_entry.data[CONF_USERNAME], config_entry.data[CONF_PASSWORD], diff --git a/homeassistant/components/opower/manifest.json b/homeassistant/components/opower/manifest.json index 0aa26dbb4b1..4e88c5a68cc 100644 --- a/homeassistant/components/opower/manifest.json +++ b/homeassistant/components/opower/manifest.json @@ -7,5 +7,5 @@ "documentation": "https://www.home-assistant.io/integrations/opower", "iot_class": "cloud_polling", "loggers": ["opower"], - "requirements": ["opower==0.12.3"] + "requirements": ["opower==0.12.4"] } diff --git a/requirements_all.txt b/requirements_all.txt index 9bd7add2790..7d0f42fc3c2 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -1617,7 +1617,7 @@ openwrt-luci-rpc==1.1.17 openwrt-ubus-rpc==0.0.2 # homeassistant.components.opower -opower==0.12.3 +opower==0.12.4 # homeassistant.components.oralb oralb-ble==0.17.6 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index 5ad03dc9069..a574f8a841e 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -1370,7 +1370,7 @@ openhomedevice==2.2.0 openwebifpy==4.3.1 # homeassistant.components.opower -opower==0.12.3 +opower==0.12.4 # homeassistant.components.oralb oralb-ble==0.17.6