From 3db6be36b7ee317d66c24b4e4f610c2472e2ed46 Mon Sep 17 00:00:00 2001 From: denpamusic Date: Wed, 25 Oct 2023 04:54:56 +0300 Subject: [PATCH] Improve code style. - Mark unused variables with underscore. - Use byteorder kwarg for consistency. --- pyplumio/frames/__init__.py | 8 ++++---- pyplumio/helpers/uid.py | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pyplumio/frames/__init__.py b/pyplumio/frames/__init__.py index e9bf43a0..55a114c0 100644 --- a/pyplumio/frames/__init__.py +++ b/pyplumio/frames/__init__.py @@ -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 {} @@ -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 {} diff --git a/pyplumio/helpers/uid.py b/pyplumio/helpers/uid.py index 2be793e4..8293fb77 100644 --- a/pyplumio/helpers/uid.py +++ b/pyplumio/helpers/uid.py @@ -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