Skip to content

Commit

Permalink
Disable IPv6 in the opower integration to fix AEP utilities (#107203)
Browse files Browse the repository at this point in the history
  • Loading branch information
tronikos authored Jan 5, 2024
1 parent 72e908f commit 2a9a046
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion homeassistant/components/opower/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

from collections.abc import Mapping
import logging
import socket
from typing import Any

from opower import (
Expand Down Expand Up @@ -38,7 +39,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, family=socket.AF_INET),
login_data[CONF_UTILITY],
login_data[CONF_USERNAME],
login_data[CONF_PASSWORD],
Expand Down
3 changes: 2 additions & 1 deletion homeassistant/components/opower/coordinator.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""Coordinator to handle Opower connections."""
from datetime import datetime, timedelta
import logging
import socket
from types import MappingProxyType
from typing import Any, cast

Expand Down Expand Up @@ -51,7 +52,7 @@ def __init__(
update_interval=timedelta(hours=12),
)
self.api = Opower(
aiohttp_client.async_get_clientsession(hass),
aiohttp_client.async_get_clientsession(hass, family=socket.AF_INET),
entry_data[CONF_UTILITY],
entry_data[CONF_USERNAME],
entry_data[CONF_PASSWORD],
Expand Down

0 comments on commit 2a9a046

Please sign in to comment.