From 0b5cef2ea14cafc326290afae4e9853d85d9f3a3 Mon Sep 17 00:00:00 2001 From: Mark Walker Date: Sat, 16 Jun 2018 22:14:49 +0000 Subject: [PATCH] Handle the NoneType case as "AUTO" Should fix #10 --- octoprint_portlister/__init__.py | 4 ++++ setup.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/octoprint_portlister/__init__.py b/octoprint_portlister/__init__.py index 69487d8..9576acb 100644 --- a/octoprint_portlister/__init__.py +++ b/octoprint_portlister/__init__.py @@ -57,6 +57,10 @@ def do_auto_connect(self, port, *args, **kwargs): try: self._logger.info("do_auto_connect") (autoport, baudrate) = self._settings.global_get(["serial", "port"]), self._settings.global_get_int(["serial", "baudrate"]) + if not autoport: + autoport = "AUTO" + if not port: + port = "AUTO" if autoport == "AUTO" or os.path.realpath(autoport) == os.path.realpath(port): self._logger.info("realpath match") printer_profile = self._printer_profile_manager.get_default() diff --git a/setup.py b/setup.py index 9f2ff3e..eab3e08 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ plugin_identifier = "portlister" plugin_package = "octoprint_portlister" plugin_name = "OctoPrint-PortLister" -plugin_version = "0.1.7" +plugin_version = "0.1.8" plugin_description = """PortLister notices when printers get turned on and tells the list of ports to refresh""" plugin_author = "Mark Walker" plugin_author_email = "markwal@hotmail.com"