Fix myq increasing number of network connections (#22432)

* Fix for network issues

Fix for network issues

* Further changes to network connection

* websession is created in pymyq

websession is created in pymyq instead.
Added call on stop event to close web session.

* Updated requirements file

* Added comment

* Changed back to use aiohttp_client

* Cleanup closed sockets in aiohttp

Enable automatic cleanup of closed sockets in aiohttp client helper.

* Updated manifest & requirements

* Updated comment block
This commit is contained in:
ehendrix23 2019-04-10 15:24:12 -06:00 committed by Paulus Schoutsen
parent 38d92b2abf
commit 7862fdd27e
4 changed files with 11 additions and 7 deletions

View file

@ -168,7 +168,10 @@ def _async_get_connector(hass: HomeAssistantType,
else:
ssl_context = False
connector = aiohttp.TCPConnector(loop=hass.loop, ssl=ssl_context)
connector = aiohttp.TCPConnector(loop=hass.loop,
enable_cleanup_closed=True,
ssl=ssl_context,
)
hass.data[key] = connector
async def _async_close_connector(event: Event) -> None: