From 2aae546145f0b6141e6dae787856a02a82559bc1 Mon Sep 17 00:00:00 2001 From: RangeOfGlitching <58881058+RangeOfGlitching@users.noreply.github.com> Date: Sun, 10 Jul 2022 18:09:15 +0800 Subject: [PATCH] Update tower.py --- 1toN/tower.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/1toN/tower.py b/1toN/tower.py index 5856d7f..96a4901 100644 --- a/1toN/tower.py +++ b/1toN/tower.py @@ -47,8 +47,10 @@ client.connect(mqtt_config["host"], mqtt_config["port"], 60) client.loop_start() # publish(topicBroadcast, "Connect", True) - -if connect_flag: - while True: - command = input("command: ") - publish(mqtt_config["topic"], command) +while True: + if connect_flag: + break + +while True: + command = input("command: ") + publish(mqtt_config["topic"], command)