From ae6a600ca7154d0548e6c4e3f80f8fadf37cada3 Mon Sep 17 00:00:00 2001 From: xyj <10908227994@qq.com> Date: Fri, 5 Jan 2024 17:11:31 +0800 Subject: [PATCH] update --- sensor_to_server.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/sensor_to_server.py b/sensor_to_server.py index ffda0c5..a09dc61 100755 --- a/sensor_to_server.py +++ b/sensor_to_server.py @@ -239,10 +239,12 @@ def p(): def on_connect(client, userdata, flags, rc): if rc == 0: - # 测试 - threading.Thread(target=p).start() - # 正式环境 - # threading.Thread(target=get_data).start() + if subscribe_topic == zhanguan_device_name: + # 测试 + threading.Thread(target=p).start() + else: + # 正式环境 + threading.Thread(target=get_data).start() if __name__ == '__main__':