Fix the prints
This commit is contained in:
7
main.py
7
main.py
@@ -140,7 +140,7 @@ def main():
|
|||||||
|
|
||||||
run = True
|
run = True
|
||||||
first_run = True
|
first_run = True
|
||||||
connected = False
|
waiting_for_connection = False
|
||||||
|
|
||||||
while run:
|
while run:
|
||||||
# Get the list of devices
|
# Get the list of devices
|
||||||
@@ -152,12 +152,13 @@ def main():
|
|||||||
# Device is not yet connected
|
# Device is not yet connected
|
||||||
device = config["Global"]["device"] # reset device to config value, in case it was TCP/IP before
|
device = config["Global"]["device"] # reset device to config value, in case it was TCP/IP before
|
||||||
first_run = True
|
first_run = True
|
||||||
if not connected:
|
if not waiting_for_connection:
|
||||||
logging.info("No device connected. Waiting silently until a device is connected.")
|
logging.info("No device connected. Waiting silently until a device is connected.")
|
||||||
|
waiting_for_connection = True
|
||||||
time.sleep(10)
|
time.sleep(10)
|
||||||
continue
|
continue
|
||||||
|
|
||||||
connected = True
|
waiting_for_connection = False
|
||||||
if device and device not in devices:
|
if device and device not in devices:
|
||||||
time.sleep(60)
|
time.sleep(60)
|
||||||
continue
|
continue
|
||||||
|
|||||||
Reference in New Issue
Block a user