Skip to content

Commit

Permalink
MyPy fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
iMicknl committed Jan 7, 2024
1 parent 81db68b commit 8a3b7e4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
1 change: 0 additions & 1 deletion sagemcom_api/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
"""Package to communicate with Sagemcom F@st internal APIs."""
__version__ = "1.0.1"
11 changes: 5 additions & 6 deletions sagemcom_api/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
from aiohttp.connector import TCPConnector
import humps

from . import __version__
from .const import (
API_ENDPOINT,
DEFAULT_TIMEOUT,
Expand Down Expand Up @@ -82,9 +81,9 @@ def __init__(
session
if session
else ClientSession(
headers={"User-Agent": f"{DEFAULT_USER_AGENT}/{__version__}"},
headers={"User-Agent": f"{DEFAULT_USER_AGENT}"},
timeout=ClientTimeout(DEFAULT_TIMEOUT),
connector=TCPConnector(ssl=verify_ssl),
connector=TCPConnector(verify_ssl=verify_ssl if verify_ssl else True),
)
)

Expand Down Expand Up @@ -304,7 +303,7 @@ async def get_value_by_xpath(
"id": 0,
"method": "getValue",
"xpath": urllib.parse.quote(xpath),
"options": options | {},
"options": options if options else {},
}

response = await self.__api_request_async([actions], False)
Expand All @@ -324,7 +323,7 @@ async def get_values_by_xpaths(self, xpaths, options: dict | None = None) -> dic
"id": i,
"method": "getValue",
"xpath": urllib.parse.quote(xpath),
"options": options | {},
"options": options if options else {},
}
for i, xpath in enumerate(xpaths.values())
]
Expand All @@ -350,7 +349,7 @@ async def set_value_by_xpath(
"method": "setValue",
"xpath": urllib.parse.quote(xpath),
"parameters": {"value": str(value)},
"options": options | None,
"options": options if options else {},
}

response = await self.__api_request_async([actions], False)
Expand Down

0 comments on commit 8a3b7e4

Please sign in to comment.