Skip to content

Commit

Permalink
Fix mypy errors after update
Browse files Browse the repository at this point in the history
  • Loading branch information
SukramJ committed Sep 7, 2024
1 parent 9653d49 commit b174c7c
Showing 1 changed file with 10 additions and 3 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

0 comments on commit b174c7c

Please sign in to comment.