1
mirror of https://github.com/home-assistant/core synced 2024-07-27 18:58:57 +02:00

Remove some passings of loop (#34995)

This commit is contained in:
Paulus Schoutsen 2020-04-30 21:34:51 -07:00 committed by GitHub
parent 225059f8ea
commit 8f9467492d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 4 additions and 12 deletions

View File

@ -230,7 +230,7 @@ async def async_setup(hass, config):
)
try:
with async_timeout.timeout(CONNECTION_TIMEOUT, loop=hass.loop):
with async_timeout.timeout(CONNECTION_TIMEOUT):
transport, protocol = await connection
except (

View File

@ -56,7 +56,6 @@ async def async_setup(hass: HomeAssistantType, config: ConfigType) -> bool:
# pylint: disable=no-member
create_process = asyncio.subprocess.create_subprocess_shell(
cmd,
loop=hass.loop,
stdin=None,
stdout=asyncio.subprocess.PIPE,
stderr=asyncio.subprocess.PIPE,
@ -69,7 +68,6 @@ async def async_setup(hass: HomeAssistantType, config: ConfigType) -> bool:
# pylint: disable=no-member
create_process = asyncio.subprocess.create_subprocess_exec(
*shlexed_cmd,
loop=hass.loop,
stdin=None,
stdout=asyncio.subprocess.PIPE,
stderr=asyncio.subprocess.PIPE,

View File

@ -100,7 +100,6 @@ async def async_setup_entry(hass, entry):
entry.data[CONF_HOST],
psk_id=entry.data[CONF_IDENTITY],
psk=entry.data[CONF_KEY],
loop=hass.loop,
)
async def on_hass_stop(event):

View File

@ -178,7 +178,7 @@ async def get_gateway_info(hass, host, identity, key):
"""Return info for the gateway."""
try:
factory = APIFactory(host, psk_id=identity, psk=key, loop=hass.loop)
factory = APIFactory(host, psk_id=identity, psk=key)
api = factory.request
gateway = Gateway()

View File

@ -64,10 +64,7 @@ def async_create_clientsession(
connector = _async_get_connector(hass, verify_ssl)
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:
@ -174,9 +171,7 @@ def _async_get_connector(
else:
ssl_context = False
connector = aiohttp.TCPConnector(
loop=hass.loop, enable_cleanup_closed=True, ssl=ssl_context
)
connector = aiohttp.TCPConnector(enable_cleanup_closed=True, ssl=ssl_context)
hass.data[key] = connector
async def _async_close_connector(event: Event) -> None: