Remove some passings of loop (#34995)
This commit is contained in:
parent
225059f8ea
commit
8f9467492d
5 changed files with 4 additions and 12 deletions
|
@ -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 (
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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):
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Add table
Reference in a new issue