Skip to content

Commit a820100

Browse files
tronikosbdraco
andauthored
Fix opower to work with aiohttp>=3.12.7 by disabling cookie quoting (home-assistant#146697)
Co-authored-by: J. Nick Koston <[email protected]>
1 parent a349653 commit a820100

File tree

5 files changed

+9
-6
lines changed

5 files changed

+9
-6
lines changed

homeassistant/components/opower/config_flow.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
CannotConnect,
1111
InvalidAuth,
1212
Opower,
13+
create_cookie_jar,
1314
get_supported_utility_names,
1415
select_utility,
1516
)
@@ -39,7 +40,7 @@ async def _validate_login(
3940
) -> dict[str, str]:
4041
"""Validate login data and return any errors."""
4142
api = Opower(
42-
async_create_clientsession(hass),
43+
async_create_clientsession(hass, cookie_jar=create_cookie_jar()),
4344
login_data[CONF_UTILITY],
4445
login_data[CONF_USERNAME],
4546
login_data[CONF_PASSWORD],

homeassistant/components/opower/coordinator.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
MeterType,
1313
Opower,
1414
ReadResolution,
15+
create_cookie_jar,
1516
)
1617
from opower.exceptions import ApiException, CannotConnect, InvalidAuth
1718

@@ -30,7 +31,8 @@
3031
from homeassistant.const import CONF_PASSWORD, CONF_USERNAME, UnitOfEnergy, UnitOfVolume
3132
from homeassistant.core import HomeAssistant, callback
3233
from homeassistant.exceptions import ConfigEntryAuthFailed
33-
from homeassistant.helpers import aiohttp_client, issue_registry as ir
34+
from homeassistant.helpers import issue_registry as ir
35+
from homeassistant.helpers.aiohttp_client import async_create_clientsession
3436
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator, UpdateFailed
3537
from homeassistant.util import dt as dt_util
3638

@@ -62,7 +64,7 @@ def __init__(
6264
update_interval=timedelta(hours=12),
6365
)
6466
self.api = Opower(
65-
aiohttp_client.async_get_clientsession(hass),
67+
async_create_clientsession(hass, cookie_jar=create_cookie_jar()),
6668
config_entry.data[CONF_UTILITY],
6769
config_entry.data[CONF_USERNAME],
6870
config_entry.data[CONF_PASSWORD],

homeassistant/components/opower/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@
77
"documentation": "https://www.home-assistant.io/integrations/opower",
88
"iot_class": "cloud_polling",
99
"loggers": ["opower"],
10-
"requirements": ["opower==0.12.3"]
10+
"requirements": ["opower==0.12.4"]
1111
}

requirements_all.txt

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

requirements_test_all.txt

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)