Fix the prints
This commit is contained in:
7
main.py
7
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
|
||||
|
||||
Reference in New Issue
Block a user