mirror of
https://github.com/home-assistant/core.git
synced 2025-08-04 05:05:09 +02:00
Remove some passings of loop (#34995)
This commit is contained in:
@@ -230,7 +230,7 @@ async def async_setup(hass, config):
|
|||||||
)
|
)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
with async_timeout.timeout(CONNECTION_TIMEOUT, loop=hass.loop):
|
with async_timeout.timeout(CONNECTION_TIMEOUT):
|
||||||
transport, protocol = await connection
|
transport, protocol = await connection
|
||||||
|
|
||||||
except (
|
except (
|
||||||
|
@@ -56,7 +56,6 @@ async def async_setup(hass: HomeAssistantType, config: ConfigType) -> bool:
|
|||||||
# pylint: disable=no-member
|
# pylint: disable=no-member
|
||||||
create_process = asyncio.subprocess.create_subprocess_shell(
|
create_process = asyncio.subprocess.create_subprocess_shell(
|
||||||
cmd,
|
cmd,
|
||||||
loop=hass.loop,
|
|
||||||
stdin=None,
|
stdin=None,
|
||||||
stdout=asyncio.subprocess.PIPE,
|
stdout=asyncio.subprocess.PIPE,
|
||||||
stderr=asyncio.subprocess.PIPE,
|
stderr=asyncio.subprocess.PIPE,
|
||||||
@@ -69,7 +68,6 @@ async def async_setup(hass: HomeAssistantType, config: ConfigType) -> bool:
|
|||||||
# pylint: disable=no-member
|
# pylint: disable=no-member
|
||||||
create_process = asyncio.subprocess.create_subprocess_exec(
|
create_process = asyncio.subprocess.create_subprocess_exec(
|
||||||
*shlexed_cmd,
|
*shlexed_cmd,
|
||||||
loop=hass.loop,
|
|
||||||
stdin=None,
|
stdin=None,
|
||||||
stdout=asyncio.subprocess.PIPE,
|
stdout=asyncio.subprocess.PIPE,
|
||||||
stderr=asyncio.subprocess.PIPE,
|
stderr=asyncio.subprocess.PIPE,
|
||||||
|
@@ -100,7 +100,6 @@ async def async_setup_entry(hass, entry):
|
|||||||
entry.data[CONF_HOST],
|
entry.data[CONF_HOST],
|
||||||
psk_id=entry.data[CONF_IDENTITY],
|
psk_id=entry.data[CONF_IDENTITY],
|
||||||
psk=entry.data[CONF_KEY],
|
psk=entry.data[CONF_KEY],
|
||||||
loop=hass.loop,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
async def on_hass_stop(event):
|
async def on_hass_stop(event):
|
||||||
|
@@ -178,7 +178,7 @@ async def get_gateway_info(hass, host, identity, key):
|
|||||||
"""Return info for the gateway."""
|
"""Return info for the gateway."""
|
||||||
|
|
||||||
try:
|
try:
|
||||||
factory = APIFactory(host, psk_id=identity, psk=key, loop=hass.loop)
|
factory = APIFactory(host, psk_id=identity, psk=key)
|
||||||
|
|
||||||
api = factory.request
|
api = factory.request
|
||||||
gateway = Gateway()
|
gateway = Gateway()
|
||||||
|
@@ -64,10 +64,7 @@ def async_create_clientsession(
|
|||||||
connector = _async_get_connector(hass, verify_ssl)
|
connector = _async_get_connector(hass, verify_ssl)
|
||||||
|
|
||||||
clientsession = aiohttp.ClientSession(
|
clientsession = aiohttp.ClientSession(
|
||||||
loop=hass.loop,
|
connector=connector, headers={USER_AGENT: SERVER_SOFTWARE}, **kwargs,
|
||||||
connector=connector,
|
|
||||||
headers={USER_AGENT: SERVER_SOFTWARE},
|
|
||||||
**kwargs,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
if auto_cleanup:
|
if auto_cleanup:
|
||||||
@@ -174,9 +171,7 @@ def _async_get_connector(
|
|||||||
else:
|
else:
|
||||||
ssl_context = False
|
ssl_context = False
|
||||||
|
|
||||||
connector = aiohttp.TCPConnector(
|
connector = aiohttp.TCPConnector(enable_cleanup_closed=True, ssl=ssl_context)
|
||||||
loop=hass.loop, enable_cleanup_closed=True, ssl=ssl_context
|
|
||||||
)
|
|
||||||
hass.data[key] = connector
|
hass.data[key] = connector
|
||||||
|
|
||||||
async def _async_close_connector(event: Event) -> None:
|
async def _async_close_connector(event: Event) -> None:
|
||||||
|
Reference in New Issue
Block a user