mirror of
https://github.com/home-assistant/core.git
synced 2025-07-13 00:07:10 +00:00
Fix opower to work with aiohttp>=3.12.7 by disabling cookie quoting (#146697)
Co-authored-by: J. Nick Koston <nick@koston.org>
This commit is contained in:
parent
a349653282
commit
a8201009f3
@ -10,6 +10,7 @@ from opower import (
|
|||||||
CannotConnect,
|
CannotConnect,
|
||||||
InvalidAuth,
|
InvalidAuth,
|
||||||
Opower,
|
Opower,
|
||||||
|
create_cookie_jar,
|
||||||
get_supported_utility_names,
|
get_supported_utility_names,
|
||||||
select_utility,
|
select_utility,
|
||||||
)
|
)
|
||||||
@ -39,7 +40,7 @@ async def _validate_login(
|
|||||||
) -> dict[str, str]:
|
) -> dict[str, str]:
|
||||||
"""Validate login data and return any errors."""
|
"""Validate login data and return any errors."""
|
||||||
api = Opower(
|
api = Opower(
|
||||||
async_create_clientsession(hass),
|
async_create_clientsession(hass, cookie_jar=create_cookie_jar()),
|
||||||
login_data[CONF_UTILITY],
|
login_data[CONF_UTILITY],
|
||||||
login_data[CONF_USERNAME],
|
login_data[CONF_USERNAME],
|
||||||
login_data[CONF_PASSWORD],
|
login_data[CONF_PASSWORD],
|
||||||
|
@ -12,6 +12,7 @@ from opower import (
|
|||||||
MeterType,
|
MeterType,
|
||||||
Opower,
|
Opower,
|
||||||
ReadResolution,
|
ReadResolution,
|
||||||
|
create_cookie_jar,
|
||||||
)
|
)
|
||||||
from opower.exceptions import ApiException, CannotConnect, InvalidAuth
|
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.const import CONF_PASSWORD, CONF_USERNAME, UnitOfEnergy, UnitOfVolume
|
||||||
from homeassistant.core import HomeAssistant, callback
|
from homeassistant.core import HomeAssistant, callback
|
||||||
from homeassistant.exceptions import ConfigEntryAuthFailed
|
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.helpers.update_coordinator import DataUpdateCoordinator, UpdateFailed
|
||||||
from homeassistant.util import dt as dt_util
|
from homeassistant.util import dt as dt_util
|
||||||
|
|
||||||
@ -62,7 +64,7 @@ class OpowerCoordinator(DataUpdateCoordinator[dict[str, Forecast]]):
|
|||||||
update_interval=timedelta(hours=12),
|
update_interval=timedelta(hours=12),
|
||||||
)
|
)
|
||||||
self.api = Opower(
|
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_UTILITY],
|
||||||
config_entry.data[CONF_USERNAME],
|
config_entry.data[CONF_USERNAME],
|
||||||
config_entry.data[CONF_PASSWORD],
|
config_entry.data[CONF_PASSWORD],
|
||||||
|
@ -7,5 +7,5 @@
|
|||||||
"documentation": "https://www.home-assistant.io/integrations/opower",
|
"documentation": "https://www.home-assistant.io/integrations/opower",
|
||||||
"iot_class": "cloud_polling",
|
"iot_class": "cloud_polling",
|
||||||
"loggers": ["opower"],
|
"loggers": ["opower"],
|
||||||
"requirements": ["opower==0.12.3"]
|
"requirements": ["opower==0.12.4"]
|
||||||
}
|
}
|
||||||
|
2
requirements_all.txt
generated
2
requirements_all.txt
generated
@ -1617,7 +1617,7 @@ openwrt-luci-rpc==1.1.17
|
|||||||
openwrt-ubus-rpc==0.0.2
|
openwrt-ubus-rpc==0.0.2
|
||||||
|
|
||||||
# homeassistant.components.opower
|
# homeassistant.components.opower
|
||||||
opower==0.12.3
|
opower==0.12.4
|
||||||
|
|
||||||
# homeassistant.components.oralb
|
# homeassistant.components.oralb
|
||||||
oralb-ble==0.17.6
|
oralb-ble==0.17.6
|
||||||
|
2
requirements_test_all.txt
generated
2
requirements_test_all.txt
generated
@ -1370,7 +1370,7 @@ openhomedevice==2.2.0
|
|||||||
openwebifpy==4.3.1
|
openwebifpy==4.3.1
|
||||||
|
|
||||||
# homeassistant.components.opower
|
# homeassistant.components.opower
|
||||||
opower==0.12.3
|
opower==0.12.4
|
||||||
|
|
||||||
# homeassistant.components.oralb
|
# homeassistant.components.oralb
|
||||||
oralb-ble==0.17.6
|
oralb-ble==0.17.6
|
||||||
|
Loading…
x
Reference in New Issue
Block a user