diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4b979dfa..468f8658 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/charliermarsh/ruff-pre-commit - rev: v0.3.0 + rev: v0.3.2 hooks: - id: ruff args: @@ -18,7 +18,7 @@ repos: exclude_types: [csv, json] exclude: ^tests/fixtures/|hahomematic/rega_scripts - repo: https://github.com/PyCQA/bandit - rev: 1.7.7 + rev: 1.7.8 hooks: - id: bandit args: diff --git a/changelog.md b/changelog.md index e648565a..3c3c6c6f 100644 --- a/changelog.md +++ b/changelog.md @@ -1,6 +1,7 @@ -# Version 2024.3.1 (2024-03-09) +# Version 2024.3.1 (2024-03-12) - Add additional parameter to HBW-LC4-IN4-DR +- Add check if init is running in the main thread # Version 2024.3.0 (2024-03-01) diff --git a/hahomematic/__init__.py b/hahomematic/__init__.py index 8868764a..7720092c 100644 --- a/hahomematic/__init__.py +++ b/hahomematic/__init__.py @@ -11,6 +11,7 @@ import logging import signal import sys +import threading from typing import Final from hahomematic import central as hmcu @@ -31,5 +32,5 @@ def signal_handler(sig, frame): # type: ignore[no-untyped-def] asyncio.run_coroutine_threadsafe(central.stop(), asyncio.get_running_loop()) -if sys.stdout.isatty(): +if threading.current_thread() is threading.main_thread() and sys.stdout.isatty(): signal.signal(signal.SIGINT, signal_handler) diff --git a/requirements_test.txt b/requirements_test.txt index 73c38b47..91e1f6de 100644 --- a/requirements_test.txt +++ b/requirements_test.txt @@ -3,7 +3,7 @@ coverage==7.4.3 freezegun==1.4.0 -mypy==1.8.0 +mypy==1.9.0 pip==24.0 pre-commit==3.6.2 pydevccu==0.1.8 @@ -15,6 +15,6 @@ pytest-asyncio==0.23.5 pytest-cov==4.1.0 pytest-rerunfailures==13.0 pytest-socket==0.7.0 -pytest-timeout==2.2.0 -pytest==8.0.2 -types-python-slugify==8.0.2.20240127 +pytest-timeout==2.3.1 +pytest==8.1.1 +types-python-slugify==8.0.2.20240310 diff --git a/requirements_test_pre_commit.txt b/requirements_test_pre_commit.txt index 265792b8..7de48edf 100644 --- a/requirements_test_pre_commit.txt +++ b/requirements_test_pre_commit.txt @@ -1,4 +1,4 @@ -bandit==1.7.7 +bandit==1.7.8 codespell==2.2.6 -ruff==0.3.0 +ruff==0.3.2 yamllint==1.35.1