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

[pre-commit.ci] pre-commit autoupdate #49

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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 @@ -2,15 +2,15 @@ ci:
autoupdate_schedule: "monthly"
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v5.0.0
hooks:
- id: trailing-whitespace
- id: check-toml
- id: no-commit-to-branch
args: [-b, master]

- repo: https://github.com/psf/black
rev: 24.1.1
rev: 25.1.0
hooks:
- id: black
name: black
Expand All @@ -19,7 +19,7 @@ repos:
types: [python]

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.8.0
rev: v1.14.1
hooks:
- id: mypy
exclude: ^docs/conf.py
Expand Down
2 changes: 1 addition & 1 deletion hart_protocol/_unpacker.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def __next__(self):
while len(self.buf) < 3:
self.buf += self._read_one_byte_if_possible()
# keep reading until we find a minimum preamble
while self.buf[:3] not in [b"\xFF\xFF\x06", b"\xFF\xFF\x86"]:
while self.buf[:3] not in [b"\xff\xff\x06", b"\xff\xff\x86"]:
self.buf += self._read_one_byte_if_possible()
self.buf = self.buf[1:]
self._decoding_error("Head of buffer not recognized as valid preamble")
Expand Down
2 changes: 1 addition & 1 deletion hart_protocol/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def pack_command(address, command_id, data=None):
address = int.from_bytes(address, "big")
if type(command_id) == int:
command_id = command_id.to_bytes(1, "big")
command = b"\xFF\xFF\xFF\xFF\xFF" # preamble
command = b"\xff\xff\xff\xff\xff" # preamble
command += b"\x82" # start charachter
command += (549755813888 | address).to_bytes(5, "big")
command += command_id
Expand Down