|
|
@@ -56,20 +56,25 @@ async def ble_task():
|
|
|
await asyncio.sleep(10)
|
|
|
continue
|
|
|
|
|
|
+ await asyncio.sleep(2)
|
|
|
+
|
|
|
try:
|
|
|
async with BleakClient(device) as client:
|
|
|
outdoorConnected = 1
|
|
|
print(f"connected to {outdoorName}")
|
|
|
|
|
|
await client.start_notify(TEMP_UUID, notification_handler)
|
|
|
+ await asyncio.sleep(0.5)
|
|
|
await client.start_notify(PRESSURE_UUID, notification_handler)
|
|
|
+ await asyncio.sleep(0.5)
|
|
|
await client.start_notify(HUMIDITY_UUID, notification_handler)
|
|
|
|
|
|
while (client.is_connected):
|
|
|
- await asyncio.sleep(1)
|
|
|
+ await asyncio.sleep(5)
|
|
|
except Exception as e:
|
|
|
outdoorConnected = 0
|
|
|
logging.exception("Exception while connecting or getting data")
|
|
|
+ await asyncio.sleep(5)
|
|
|
async def sensor_task():
|
|
|
global indoorValues
|
|
|
|