-
-
Notifications
You must be signed in to change notification settings - Fork 32.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Disable IPV6 in the august integration (#98003)
- Loading branch information
Showing
3 changed files
with
29 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
"""August util functions.""" | ||
|
||
import socket | ||
|
||
import aiohttp | ||
|
||
from homeassistant.core import HomeAssistant, callback | ||
from homeassistant.helpers import aiohttp_client | ||
|
||
|
||
@callback | ||
def async_create_august_clientsession(hass: HomeAssistant) -> aiohttp.ClientSession: | ||
"""Create an aiohttp session for the august integration.""" | ||
# Create an aiohttp session instead of using the default one since the | ||
# default one is likely to trigger august's WAF if another integration | ||
# is also using Cloudflare | ||
# | ||
# The family is set to AF_INET because IPv6 keeps coming up as an issue | ||
# see https://github.com/home-assistant/core/issues/97146 | ||
# | ||
# When https://github.com/aio-libs/aiohttp/issues/4451 is implemented | ||
# we can allow IPv6 again | ||
# | ||
return aiohttp_client.async_create_clientsession(hass, family=socket.AF_INET) |