Skip to content

Commit a8d02ed

Browse files
committed
format and lint exception
1 parent 426eaa5 commit a8d02ed

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

adafruit_usb_host_mouse.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ class BootMouse:
113113
:param was_attached: Whether the usb device was attached to the kernel
114114
"""
115115

116-
def __init__(self, device, endpoint_address, tilegrid, was_attached, scale=1):
116+
def __init__(self, device, endpoint_address, tilegrid, was_attached, scale=1): # noqa: PLR0913, too many args
117117
self.device = device
118118
self.tilegrid = tilegrid
119119
self.endpoint = endpoint_address
@@ -174,8 +174,12 @@ def update(self):
174174

175175
# update the mouse tilegrid x and y coordinates
176176
# based on the delta values read from the mouse
177-
self.tilegrid.x = max(0, min((self.display_size[0] // self.scale) - 1, self.tilegrid.x + self.buffer[1]))
178-
self.tilegrid.y = max(0, min((self.display_size[1] // self.scale) - 1, self.tilegrid.y + self.buffer[2]))
177+
self.tilegrid.x = max(
178+
0, min((self.display_size[0] // self.scale) - 1, self.tilegrid.x + self.buffer[1])
179+
)
180+
self.tilegrid.y = max(
181+
0, min((self.display_size[1] // self.scale) - 1, self.tilegrid.y + self.buffer[2])
182+
)
179183

180184
pressed_btns = []
181185
for i, button in enumerate(BUTTONS):

0 commit comments

Comments
 (0)