Skip to content

Commit

Permalink
Fixed and improved command delay doc
Browse files Browse the repository at this point in the history
  • Loading branch information
flozz committed Sep 2, 2024
1 parent 9e38370 commit eb1da1d
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions rivalcfg/mouse.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ class Mouse:
:func:`rivalcfg.usbhid.open_device`).
:param mouse_profile: One of the rivalcfg mouse profile (provided by
:func:`rivalcfg.devices.get_profile`).
:param float command_delay: Waiting time beween two commands to not
overload the device.
>>> from rivalcfg import usbhid
>>> from rivalcfg import devices
Expand All @@ -76,8 +78,6 @@ class Mouse:
#: The mouse settings (:class:`rivalcfg.mouse_settings.MouseSettings`)
mouse_settings = None

#: Waiting time for the mouse to process and approve the command
# Setting the value too low may cause the device to freeze and potentially even break.
_MIN_COMMAND_DELAY = 0.001
_command_approve_delay = None

Expand All @@ -90,9 +90,13 @@ def __init__(self, hid_device, mouse_profile, mouse_settings, command_delay=0.05

@property
def command_delay(self):
"""Waiting time for the mouse to process and approve the command
"""Waiting time beween two commands to not overload the device.
Setting the value too low may cause the device to freeze and potentially even break.
.. WARNING::
Setting this value too low can hang the device. Some mice like the
Kinzu v2 are known to become laggy or even to crash when commands
are sent too quickly.
"""
return self._command_delay

Expand Down

0 comments on commit eb1da1d

Please sign in to comment.