eric6/MicroPython/MicroPythonDevices.py

changeset 8134
a5c4ac339f2a
parent 8133
4d1d1c248f79
child 8218
7c09585bd960
diff -r 4d1d1c248f79 -r a5c4ac339f2a eric6/MicroPython/MicroPythonDevices.py
--- a/eric6/MicroPython/MicroPythonDevices.py	Wed Feb 24 17:55:10 2021 +0100
+++ b/eric6/MicroPython/MicroPythonDevices.py	Wed Feb 24 20:17:35 2021 +0100
@@ -182,10 +182,12 @@
     
     @return tuple containing a list of tuples with the board type, the port
         description, a description, the serial port it is connected at, the
-        VID and PID for known device types and a list of tuples with VID, PID
-        and description for unknown devices
+        VID and PID for known device types, a list of tuples with VID, PID
+        and description for unknown devices and a list of tuples with VID,
+        PID, description and port name for ports with missing VID or PID
     @rtype tuple of (list of tuples of (str, str, str, str, int, int),
-        list of tuples of (int, int, str)
+        list of tuples of (int, int, str),
+        list of tuples of (int, int, str, str)
     """
     from PyQt5.QtSerialPort import QSerialPortInfo
     
@@ -241,14 +243,17 @@
                 ))
                 supported = True
         if not supported:
-            if vid and pid and (vid, pid) not in IgnoredBoards:
-                unknownDevices.append((vid, pid, port.description()))
-                logging.debug("Unknown device: (0x%04x:0x%04x %s)",
-                              vid, pid, port.description())
+            if vid and pid:
+                if (vid, pid) not in IgnoredBoards:
+                    unknownDevices.append((vid, pid, port.description()))
+                    logging.debug("Unknown device: (0x%04x:0x%04x %s)",
+                                  vid, pid, port.description())
             else:
+                # either VID or PID or both not detected
                 desc = port.description()
                 if not desc:
-                    desc = "Unknown Device"
+                    desc = QCoreApplication.translate("MicroPythonDevice",
+                                                      "Unknown Device")
                 unknownPorts.append((vid, pid, desc, port.portName()))
     
     return foundDevices, unknownDevices, unknownPorts

eric ide

mercurial