Skip to content

Commit

Permalink
Improve code style.
Browse files Browse the repository at this point in the history
- Mark unused variables with underscore.
- Use byteorder kwarg for consistency.
  • Loading branch information
denpamusic committed Oct 25, 2023
1 parent 36691fa commit 3db6be3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions pyplumio/frames/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,11 +160,11 @@ def bytes(self) -> bytes:
class Request(Frame):
"""Represents a request."""

def create_message(self, data: EventDataType) -> bytearray:
def create_message(self, _: EventDataType) -> bytearray:
"""Create a frame message."""
return bytearray()

def decode_message(self, message: bytearray) -> EventDataType:
def decode_message(self, _: bytearray) -> EventDataType:
"""Decode a frame message."""
return {}

Expand All @@ -176,11 +176,11 @@ def response(self, **args) -> Response | None:
class Response(Frame):
"""Represents a response."""

def create_message(self, data: EventDataType) -> bytearray:
def create_message(self, _: EventDataType) -> bytearray:
"""Create a frame message."""
return bytearray()

def decode_message(self, message: bytearray) -> EventDataType:
def decode_message(self, _: bytearray) -> EventDataType:
"""Decode a frame message."""
return {}

Expand Down
2 changes: 1 addition & 1 deletion pyplumio/helpers/uid.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def unpack_uid(message: bytearray, offset: int = 0) -> str:
def _base5(data: bytes) -> str:
"""Encode bytes to a base5 encoded string."""
key_string = "0123456789ABCDEFGHIJKLMNZPQRSTUV"
number = int.from_bytes(data, "little")
number = int.from_bytes(data, byteorder="little")
output = ""
while number:
output = key_string[number & 0b00011111] + output
Expand Down

0 comments on commit 3db6be3

Please sign in to comment.