mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2025-12-12 09:10:30 +08:00
style fixes
This commit is contained in:
parent
2f92e95bf0
commit
c162bb7ea4
@ -174,7 +174,7 @@ class Plugin(BaseUserGpioDriver): # pylint: disable=too-many-instance-attribute
|
|||||||
|
|
||||||
if found:
|
if found:
|
||||||
try:
|
try:
|
||||||
channel = int(found[-1][2:4])-1
|
channel = int(found[-1][2:4]) - 1
|
||||||
except Exception:
|
except Exception:
|
||||||
return (None, data)
|
return (None, data)
|
||||||
assert 0 <= channel <= 3
|
assert 0 <= channel <= 3
|
||||||
@ -182,11 +182,11 @@ class Plugin(BaseUserGpioDriver): # pylint: disable=too-many-instance-attribute
|
|||||||
|
|
||||||
def __send_channel(self, tty: serial.Serial, channel: int) -> None:
|
def __send_channel(self, tty: serial.Serial, channel: int) -> None:
|
||||||
assert 0 <= channel <= 3
|
assert 0 <= channel <= 3
|
||||||
cmd = "SW{port}\r\nAG{port:02d}gA".format(port=channel+1).encode()
|
cmd = "SW{port}\r\nAG{port:02d}gA".format(port=(channel + 1)).encode()
|
||||||
tty.write(cmd)
|
tty.write(cmd)
|
||||||
tty.flush()
|
tty.flush()
|
||||||
|
|
||||||
def __str__(self) -> str:
|
def __str__(self) -> str:
|
||||||
return f"Xh_hk4401({self._instance_name})"
|
return f"XH-HK4401({self._instance_name})"
|
||||||
|
|
||||||
__repr__ = __str__
|
__repr__ = __str__
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user