Skip to content

Commit

Permalink
base: Add type hints
Browse files Browse the repository at this point in the history
  • Loading branch information
MattHag committed Sep 15, 2024
1 parent 5703e97 commit ef71a2c
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions lib/logitech_receiver/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,16 @@ def _get_next_sw_id() -> int:


# a very few requests (e.g., host switching) do not expect a reply, but use no_reply=True with extreme caution
def request(handle, devnumber, request_id, *params, no_reply=False, return_error=False, long_message=False, protocol=1.0):
def request(
handle,
devnumber,
request_id: int,
*params,
no_reply: bool = False,
return_error: bool = False,
long_message: bool = False,
protocol: float = 1.0,
):
"""Makes a feature call to a device and waits for a matching reply.
:param handle: an open UR handle.
:param devnumber: attached device number.
Expand Down Expand Up @@ -554,7 +563,7 @@ def request(handle, devnumber, request_id, *params, no_reply=False, return_error
# raise DeviceUnreachable(number=devnumber, request=request_id)


def ping(handle, devnumber, long_message=False):
def ping(handle, devnumber, long_message: bool = False):
"""Check if a device is connected to the receiver.
:returns: The HID protocol supported by the device, as a floating point number, if the device is active.
"""
Expand Down

0 comments on commit ef71a2c

Please sign in to comment.