Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(pre-commit.ci): pre-commit autoupdate #202

Merged
merged 2 commits into from
Feb 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@ repos:
- id: pyupgrade
args: [--py311-plus]
- repo: https://github.com/PyCQA/isort
rev: 5.13.2
rev: 6.0.0
hooks:
- id: isort
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 24.10.0
rev: 25.1.0
hooks:
- id: black
- repo: https://github.com/codespell-project/codespell
rev: v2.4.0
rev: v2.4.1
hooks:
- id: codespell
- repo: https://github.com/PyCQA/flake8
Expand Down
2 changes: 1 addition & 1 deletion src/bthome_ble/bthome_v1_encryption.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def main() -> None:
print("Preparing data for encryption")
count_id = bytes(bytearray.fromhex("00112233")) # count id (change every message)
mac = binascii.unhexlify("5448E68F80A5") # MAC
uuid16 = b"\x1E\x18"
uuid16 = b"\x1e\x18"
bindkey = binascii.unhexlify("231d39c1d7cc1ab1aee224cd096db932")

payload = encrypt_payload(
Expand Down
2 changes: 1 addition & 1 deletion src/bthome_ble/bthome_v2_encryption.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def main() -> None:
print("Preparing data for encryption")
count_id = bytes(bytearray.fromhex("00112233")) # count id (change every message)
mac = binascii.unhexlify("5448E68F80A5") # MAC
uuid16 = b"\xD2\xFC"
uuid16 = b"\xd2\xfc"
sw_version = b"\x41"
bindkey = binascii.unhexlify("231d39c1d7cc1ab1aee224cd096db932")

Expand Down
14 changes: 7 additions & 7 deletions tests/test_parser_v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ def test_bthome_illuminance(caplog):

def test_bthome_mass_kilograms(caplog):
"""Test BTHome parser for mass reading in kilograms without encryption."""
data_string = b"\x43\x06\xFE\x70"
data_string = b"\x43\x06\xfe\x70"
advertisement = bytes_to_service_info(
data_string, local_name="TEST DEVICE", address="A4:C1:38:8D:18:B2"
)
Expand Down Expand Up @@ -485,7 +485,7 @@ def test_bthome_mass_kilograms(caplog):

def test_bthome_mass_pounds(caplog):
"""Test BTHome parser for mass reading in pounds without encryption."""
data_string = b"\x03\x07\x3E\x1d"
data_string = b"\x03\x07\x3e\x1d"
advertisement = bytes_to_service_info(
data_string, local_name="TEST DEVICE", address="A4:C1:38:8D:18:B2"
)
Expand Down Expand Up @@ -525,7 +525,7 @@ def test_bthome_mass_pounds(caplog):

def test_bthome_dew_point(caplog):
"""Test BTHome parser for dew point reading without encryption."""
data_string = b"\x23\x08\xCA\x06"
data_string = b"\x23\x08\xca\x06"
advertisement = bytes_to_service_info(
data_string, local_name="TEST DEVICE", address="A4:C1:38:8D:18:B2"
)
Expand Down Expand Up @@ -733,7 +733,7 @@ def test_bthome_voltage(caplog):

def test_bthome_binary_sensor(caplog):
"""Test BTHome parser for binary sensor without device class, without encryption."""
data_string = b"\x02\x0F\x01"
data_string = b"\x02\x0f\x01"
advertisement = bytes_to_service_info(
data_string, local_name="TEST DEVICE", address="A4:C1:38:8D:18:B2"
)
Expand Down Expand Up @@ -963,7 +963,7 @@ def test_bthome_co2(caplog):

def test_bthome_timestamp(caplog):
"""Test BTHome parser for Unix timestamp (seconds from 1-1-1970)."""
data_string = b"\xA5\x50\x5D\x39\x61\x64"
data_string = b"\xa5\x50\x5d\x39\x61\x64"
advertisement = bytes_to_service_info(
data_string, local_name="TEST DEVICE", address="A4:C1:38:8D:18:B2"
)
Expand Down Expand Up @@ -1092,7 +1092,7 @@ def test_bthome_moisture(caplog):

def test_bthome_event_button_long_press(caplog):
"""Test BTHome parser for an event of a long press on a button without encryption."""
data_string = b"\x02\x3A\x04"
data_string = b"\x02\x3a\x04"
advertisement = bytes_to_service_info(
data_string, local_name="TEST DEVICE", address="A4:C1:38:8D:18:B2"
)
Expand Down Expand Up @@ -1135,7 +1135,7 @@ def test_bthome_event_button_long_press(caplog):

def test_bthome_event_dimmer_rotate_left_3_steps(caplog):
"""Test BTHome parser for an event rotating a dimmer 3 steps left."""
data_string = b"\x03\x3C\x01\x03"
data_string = b"\x03\x3c\x01\x03"
advertisement = bytes_to_service_info(
data_string, local_name="TEST DEVICE", address="A4:C1:38:8D:18:B2"
)
Expand Down
Loading