style fixes

This commit is contained in:
Maxim Devaev 2021-10-01 15:37:52 +03:00
parent 2f92e95bf0
commit c162bb7ea4

View File

@ -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__