Fix port-override for aes&klap transports (#734)

* Fix port-override for aes&klap transports

* Add tests for port override
This commit is contained in:
Teemu R
2024-02-03 15:28:20 +01:00
committed by GitHub
parent 414489ff18
commit fae071f0df
6 changed files with 39 additions and 13 deletions

View File

@@ -1,5 +1,6 @@
"""Module for HttpClientSession class."""
import asyncio
import logging
from typing import Any, Dict, Optional, Tuple, Union
import aiohttp
@@ -13,6 +14,8 @@ from .exceptions import (
)
from .json import loads as json_loads
_LOGGER = logging.getLogger(__name__)
def get_cookie_jar() -> aiohttp.CookieJar:
"""Return a new cookie jar with the correct options for device communication."""
@@ -54,6 +57,7 @@ class HttpClient:
If the request is provided via the json parameter json will be returned.
"""
_LOGGER.debug("Posting to %s", url)
response_data = None
self._last_url = url
self.client.cookie_jar.clear()