Skip to content

Commit 35aec6c

Browse files
committed
Fix add_ports()
When multiple where added to a hub via add_ports(first, last) only last-1 ports were created. This is now fixed. Also the function arguments were renamed to `first_port` and `last_port` Signed-off-by: Nicolai Buchwitz <nb@tipi-net.de>
1 parent 1320613 commit 35aec6c

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

uhubctl/usb.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,15 +62,15 @@ def add_port(self, port_number: int) -> 'Port':
6262

6363
return port
6464

65-
def add_ports(self, port_start: int, port_end: int):
65+
def add_ports(self, first_port: int, last_port: int):
6666
"""
6767
Add multiple ports to hub
6868
6969
Arguments:
70-
port_start: First port's indentification number
71-
port_end: Last port's ndentification number
70+
first_port: First port's indentification number
71+
last_port: Last port's ndentification number
7272
"""
73-
for port_number in range(port_start, port_end):
73+
for port_number in range(first_port, last_port+1):
7474
self.add_port(port_number)
7575

7676
def find_port(self, port_number: int) -> Optional['Port']:

0 commit comments

Comments
 (0)