diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c425ca0..3e44ab5 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -17,5 +17,14 @@ repos: rev: v1.13.0 hooks: - id: mypy - additional_dependencies: [types-requests==2.27.11] + additional_dependencies: + [ + types-requests>=2.21.0, + websockets>=13, + aiohttp>=3.8.1, + async_timeout>=4.0.3, + cryptography>=35.0.0, + py3rijndael>=0.3.3, + ] exclude: setup|docs/|example/|tests/ + args: [--strict] diff --git a/pyproject.toml b/pyproject.toml index 80ed746..1d96588 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -60,7 +60,10 @@ exclude = [ ] [[tool.mypy.overrides]] -module = 'websocket.*' +module = [ + 'py3rijndael.*', + 'websocket.*', +] ignore_missing_imports = true [[tool.mypy.overrides]] diff --git a/samsungtvws/encrypted/session.py b/samsungtvws/encrypted/session.py index 098bcd3..0cb03a2 100644 --- a/samsungtvws/encrypted/session.py +++ b/samsungtvws/encrypted/session.py @@ -36,7 +36,7 @@ def _decrypt(self, enc: bytes) -> str: def _encrypt(self, raw: str) -> bytes: encryptor = self._cipher.encryptor() - return ( # type:ignore[no-any-return] + return ( encryptor.update(bytes(Padding.pad(raw), encoding="utf8")) + encryptor.finalize() )