From 863393f6dd60f5189456aba31dec842cf7607116 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 1 Jul 2024 18:17:28 +0000 Subject: [PATCH 1/2] chore(pre-commit.ci): pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/commitizen-tools/commitizen: v3.2.2 → v3.27.0](https://github.com/commitizen-tools/commitizen/compare/v3.2.2...v3.27.0) - [github.com/pre-commit/pre-commit-hooks: v4.5.0 → v4.6.0](https://github.com/pre-commit/pre-commit-hooks/compare/v4.5.0...v4.6.0) - [github.com/asottile/pyupgrade: v3.15.0 → v3.16.0](https://github.com/asottile/pyupgrade/compare/v3.15.0...v3.16.0) - [github.com/psf/black-pre-commit-mirror: 23.12.1 → 24.4.2](https://github.com/psf/black-pre-commit-mirror/compare/23.12.1...24.4.2) - [github.com/codespell-project/codespell: v2.2.6 → v2.3.0](https://github.com/codespell-project/codespell/compare/v2.2.6...v2.3.0) - [github.com/PyCQA/flake8: 7.0.0 → 7.1.0](https://github.com/PyCQA/flake8/compare/7.0.0...7.1.0) - [github.com/pre-commit/mirrors-mypy: v1.8.0 → v1.10.1](https://github.com/pre-commit/mirrors-mypy/compare/v1.8.0...v1.10.1) - [github.com/PyCQA/bandit: 1.7.6 → 1.7.9](https://github.com/PyCQA/bandit/compare/1.7.6...1.7.9) --- .pre-commit-config.yaml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 6b99538..6fcadca 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -9,12 +9,12 @@ ci: repos: - repo: https://github.com/commitizen-tools/commitizen - rev: v3.2.2 + rev: v3.27.0 hooks: - id: commitizen stages: [commit-msg] - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.5.0 + rev: v4.6.0 hooks: - id: debug-statements - id: check-builtin-literals @@ -33,7 +33,7 @@ repos: # hooks: # - id: prettier - repo: https://github.com/asottile/pyupgrade - rev: v3.15.0 + rev: v3.16.0 hooks: - id: pyupgrade args: [--py37-plus] @@ -42,23 +42,23 @@ repos: hooks: - id: isort - repo: https://github.com/psf/black-pre-commit-mirror - rev: 23.12.1 + rev: 24.4.2 hooks: - id: black - repo: https://github.com/codespell-project/codespell - rev: v2.2.6 + rev: v2.3.0 hooks: - id: codespell - repo: https://github.com/PyCQA/flake8 - rev: 7.0.0 + rev: 7.1.0 hooks: - id: flake8 - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.8.0 + rev: v1.10.1 hooks: - id: mypy - repo: https://github.com/PyCQA/bandit - rev: 1.7.6 + rev: 1.7.9 hooks: - id: bandit args: [-x, tests] From 589bac1146970c0b3cd4ef830817498d874b6ec8 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 1 Jul 2024 18:18:16 +0000 Subject: [PATCH 2/2] chore(pre-commit.ci): auto fixes --- src/bthome_ble/__init__.py | 1 + src/bthome_ble/bthome_v1_encryption.py | 1 + src/bthome_ble/bthome_v2_encryption.py | 1 + src/bthome_ble/const.py | 1 + src/bthome_ble/event.py | 1 + src/bthome_ble/parser.py | 1 + tests/test_parser_v1.py | 1 + tests/test_parser_v2.py | 1 + tests/test_v1_encryption.py | 1 + tests/test_v2_encryption.py | 1 + 10 files changed, 10 insertions(+) diff --git a/src/bthome_ble/__init__.py b/src/bthome_ble/__init__.py index 5b9becb..223ac87 100644 --- a/src/bthome_ble/__init__.py +++ b/src/bthome_ble/__init__.py @@ -1,4 +1,5 @@ """Parser for BLE advertisements in BTHome format.""" + from __future__ import annotations from sensor_state_data import ( diff --git a/src/bthome_ble/bthome_v1_encryption.py b/src/bthome_ble/bthome_v1_encryption.py index 12a7391..c4e51c7 100644 --- a/src/bthome_ble/bthome_v1_encryption.py +++ b/src/bthome_ble/bthome_v1_encryption.py @@ -1,4 +1,5 @@ """Example showing encoding and decoding of BTHome v1 advertisement""" + from __future__ import annotations import binascii diff --git a/src/bthome_ble/bthome_v2_encryption.py b/src/bthome_ble/bthome_v2_encryption.py index 47ad1e4..e2d432e 100644 --- a/src/bthome_ble/bthome_v2_encryption.py +++ b/src/bthome_ble/bthome_v2_encryption.py @@ -1,4 +1,5 @@ """Example showing encoding and decoding of BTHome v2 advertisement""" + from __future__ import annotations import binascii diff --git a/src/bthome_ble/const.py b/src/bthome_ble/const.py index 4803993..05ea0f0 100644 --- a/src/bthome_ble/const.py +++ b/src/bthome_ble/const.py @@ -1,4 +1,5 @@ """Constants for BTHome measurements.""" + import dataclasses from typing import Union diff --git a/src/bthome_ble/event.py b/src/bthome_ble/event.py index 6c2cc6a..94ddc5c 100644 --- a/src/bthome_ble/event.py +++ b/src/bthome_ble/event.py @@ -1,4 +1,5 @@ """Event constants for BTHome measurements.""" + from __future__ import annotations from sensor_state_data.enum import StrEnum diff --git a/src/bthome_ble/parser.py b/src/bthome_ble/parser.py index d152ee7..33c7650 100644 --- a/src/bthome_ble/parser.py +++ b/src/bthome_ble/parser.py @@ -8,6 +8,7 @@ MIT License applies. """ + from __future__ import annotations import logging diff --git a/tests/test_parser_v1.py b/tests/test_parser_v1.py index bb03d80..991831b 100644 --- a/tests/test_parser_v1.py +++ b/tests/test_parser_v1.py @@ -1,4 +1,5 @@ """Tests for the parser of BLE advertisements in BTHome V1 format.""" + import logging from datetime import datetime, timezone from unittest.mock import patch diff --git a/tests/test_parser_v2.py b/tests/test_parser_v2.py index 3ff8bc3..7aac8b5 100644 --- a/tests/test_parser_v2.py +++ b/tests/test_parser_v2.py @@ -1,4 +1,5 @@ """Tests for the parser of BLE advertisements in BTHome V2 format.""" + import logging from datetime import datetime, timezone from unittest.mock import patch diff --git a/tests/test_v1_encryption.py b/tests/test_v1_encryption.py index 3c932a1..d419fd7 100644 --- a/tests/test_v1_encryption.py +++ b/tests/test_v1_encryption.py @@ -1,4 +1,5 @@ """Tests for the parser of BLE advertisements in BTHome V1 format.""" + import binascii from bthome_ble.bthome_v1_encryption import decrypt_aes_ccm, encrypt_payload diff --git a/tests/test_v2_encryption.py b/tests/test_v2_encryption.py index b6e9441..36d3910 100644 --- a/tests/test_v2_encryption.py +++ b/tests/test_v2_encryption.py @@ -1,4 +1,5 @@ """Tests for the parser of BLE advertisements in BTHome V2 format.""" + import binascii from bthome_ble.bthome_v2_encryption import decrypt_aes_ccm, encrypt_payload