Skip to content

Commit cb1e88c

Browse files
committed
util/agents/usb_hid_relay: run ruff format
Signed-off-by: Jan Luebbe <[email protected]>
1 parent 2000489 commit cb1e88c

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

labgrid/util/agents/usb_hid_relay.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
1111
- Turn digital output on and off
1212
"""
13+
1314
import usb.core
1415
import usb.util
1516

@@ -32,21 +33,21 @@ def set_output(self, number, status):
3233
self._dev.ctrl_transfer(
3334
usb.util.CTRL_TYPE_CLASS | usb.util.CTRL_RECIPIENT_DEVICE | usb.util.ENDPOINT_OUT,
3435
SET_REPORT,
35-
(REPORT_TYPE_FEATURE << 8) | 0, # no report ID
36+
(REPORT_TYPE_FEATURE << 8) | 0, # no report ID
3637
0,
37-
req, # payload
38+
req, # payload
3839
)
3940

4041
def get_output(self, number):
4142
assert 1 <= number <= 8
4243
resp = self._dev.ctrl_transfer(
4344
usb.util.CTRL_TYPE_CLASS | usb.util.CTRL_RECIPIENT_DEVICE | usb.util.ENDPOINT_IN,
4445
GET_REPORT,
45-
(REPORT_TYPE_FEATURE << 8) | 0, # no report ID
46+
(REPORT_TYPE_FEATURE << 8) | 0, # no report ID
4647
0,
47-
8, # size
48+
8, # size
4849
)
49-
return bool(resp[7] & (1 << (number-1)))
50+
return bool(resp[7] & (1 << (number - 1)))
5051

5152
def __del__(self):
5253
usb.util.release_interface(self._dev, 0)
@@ -63,6 +64,6 @@ def handle_get(busnum, devnum, number):
6364

6465

6566
methods = {
66-
'set': handle_set,
67-
'get': handle_get,
67+
"set": handle_set,
68+
"get": handle_get,
6869
}

0 commit comments

Comments
 (0)