Skip to content

Commit

Permalink
Fix mypy errors after update (#1700)
Browse files Browse the repository at this point in the history
* Update requirements

* Fix mypy errors after update
  • Loading branch information
SukramJ authored Sep 7, 2024
1 parent 1b5f8cb commit 18fcffe
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
13 changes: 10 additions & 3 deletions hahomematic/client/json_rpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,16 @@
import logging
import os
from pathlib import Path
from ssl import SSLContext
from typing import Any, Final

from aiohttp import ClientConnectorCertificateError, ClientError, ClientResponse, ClientSession
from aiohttp import (
ClientConnectorCertificateError,
ClientError,
ClientResponse,
ClientSession,
ClientTimeout,
)
import orjson

from hahomematic import central as hmcu, config
Expand Down Expand Up @@ -108,7 +115,7 @@ def __init__(
self._password: Final = password
self._looper = Looper()
self._tls: Final = tls
self._tls_context: Final = get_tls_context(verify_tls) if tls else None
self._tls_context: Final[SSLContext | bool] = get_tls_context(verify_tls) if tls else False
self._url: Final = f"{device_url}{PATH_JSON_RPC}"
self._script_cache: Final[dict[str, str]] = {}
self._last_session_id_refresh: datetime | None = None
Expand Down Expand Up @@ -312,7 +319,7 @@ async def _do_post(
self._url,
data=payload,
headers=headers,
timeout=config.TIMEOUT,
timeout=ClientTimeout(total=config.TIMEOUT),
ssl=self._tls_context,
)
) is None:
Expand Down
5 changes: 3 additions & 2 deletions requirements_test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ freezegun==1.5.1
mypy-dev==1.12.0a3
pip==24.2
pre-commit==3.8.0
pydantic==2.8.2
pur==7.3.2
pydantic==2.9.0
pydevccu==0.1.8
pylint-per-file-ignores==1.3.2
pylint-strict-informational==0.1
Expand All @@ -19,4 +20,4 @@ pytest-socket==0.7.0
pytest-timeout==2.3.1
pytest==8.3.2
types-python-slugify==8.0.2.20240310
uv==0.4.5
uv==0.4.7
2 changes: 1 addition & 1 deletion requirements_test_pre_commit.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
bandit==1.7.9
codespell==2.3.0
ruff==0.6.3
ruff==0.6.4
yamllint==1.35.1

0 comments on commit 18fcffe

Please sign in to comment.