marek 1 月之前
父节点
当前提交
23892e01f1
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      apps/getData.py

+ 2 - 1
apps/getData.py

@@ -67,7 +67,8 @@ async def ble_task():
                 await client.start_notify(HUMIDITY_UUID, notification_handler)
                 await client.start_notify(ALTITUDE_UUID, notification_handler)
 
-                await asyncio.sleep(1)
+                while (client.is_connected):
+                    await asyncio.sleep(1)
         except Exception:
             outdoorConnected = 0
             print("exception while connecting or getting data")