autoconnect only if there is exactly one device

Signed-off-by: Martin <Ho-Ro@users.noreply.github.com>
pull/645/head
Martin 2023-06-22 09:19:10 +02:00
rodzic 3437520e11
commit 627e83c823
2 zmienionych plików z 3 dodań i 3 usunięć

Wyświetl plik

@ -473,8 +473,8 @@ class NanoVNASaver(QWidget):
logger.debug("Finished building interface")
def auto_connect( self ): # connect to the 1st detected serial device
if self.serial_control.inp_port.currentData():
def auto_connect( self ): # connect if there is exactly one detected serial device
if self.serial_control.inp_port.count() == 1:
self.serial_control.connect_device()
def _sweep_control(self, start: bool = True) -> None:

Wyświetl plik

@ -47,7 +47,7 @@ def main():
"-D", "--debug-file", help="File to write debug logging output to"
)
parser.add_argument(
"-a", "--auto-connect", action="store_true", help="Auto connect to detected 1st device"
"-a", "--auto-connect", action="store_true", help="Auto connect if one device detected"
)
parser.add_argument(
"-f",