Skip to content

Commit b1bddd1

Browse files
committed
Make port status work again
Port status is broken since 203459d as it sets the datatype of `port_number` to `int` instead of `str`. This has been fixed by casting `port_number` to `str` when used in command arguments. Signed-off-by: Nicolai Buchwitz <[email protected]>
1 parent ca53b1f commit b1bddd1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

uhubctl/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ def status(self) -> bool:
134134
status = None
135135
pattern = re.compile(f" Port {self.port_number}: \d{{4}} (power|off)")
136136

137-
args = ["-l", self.hub.path, "-p", self.port_number]
137+
args = ["-l", self.hub.path, "-p", str(self.port_number)]
138138
for line in _uhubctl(args):
139139
reg = pattern.match(line)
140140

@@ -148,7 +148,7 @@ def status(self) -> bool:
148148

149149
@status.setter
150150
def status(self, status: bool) -> None:
151-
args = ["-l", self.hub.path, "-p", self.port_number, "-a"]
151+
args = ["-l", self.hub.path, "-p", str(self.port_number), "-a"]
152152

153153
if status:
154154
args.append("on")

0 commit comments

Comments
 (0)