diff --git a/main.py b/main.py index 2b8169e..f64317e 100755 --- a/main.py +++ b/main.py @@ -140,7 +140,7 @@ def main(): run = True first_run = True - connected = False + waiting_for_connection = False while run: # Get the list of devices @@ -152,12 +152,13 @@ def main(): # Device is not yet connected device = config["Global"]["device"] # reset device to config value, in case it was TCP/IP before first_run = True - if not connected: + if not waiting_for_connection: logging.info("No device connected. Waiting silently until a device is connected.") + waiting_for_connection = True time.sleep(10) continue - connected = True + waiting_for_connection = False if device and device not in devices: time.sleep(60) continue