From c2c368dd12f8d06b86acbcaebbd1025be85e3fb6 Mon Sep 17 00:00:00 2001 From: Michael Baisch Date: Tue, 11 Oct 2022 12:13:08 +0200 Subject: [PATCH] Fix bug where defining a serial portname doesn't work Fixes #1 --- wlkata_mirobot/wlkata_mirobot_serial.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wlkata_mirobot/wlkata_mirobot_serial.py b/wlkata_mirobot/wlkata_mirobot_serial.py index f17574e..181b964 100644 --- a/wlkata_mirobot/wlkata_mirobot_serial.py +++ b/wlkata_mirobot/wlkata_mirobot_serial.py @@ -246,11 +246,11 @@ def __init__(self, mirobot, portname=None, baudrate=None, stopbits=None, exclusi if autofindport and portname is None: self.default_portname = self._find_portname() """ The default portname to use when making connections. To override this on a individual basis, provide portname to each invokation of `WlkataMirobotGcodeProtocol.connect`. """ - serial_device_kwargs['portname'] = self.default_portname self.logger.info(f"Using Serial Port \"{self.default_portname}\"") else: # 设置端口号 self.default_portname = portname + serial_device_kwargs['portname'] = self.default_portname # 创建串口设备 self.serial_device = DeviceSerial(**serial_device_kwargs) # 打开串口