autocommit

This commit is contained in:
ALIHAN DIKEL
2024-10-29 02:15:50 +03:00
parent 896dfad717
commit af9b78f28a

View File

@@ -67,9 +67,13 @@ async def collect_flight_stats(state):
else:
if counter % 10 == 0:
logger.warning("missing connection, pinging tello")
response = await asyncio.to_thread(tello.send_command_with_return, "command", 3)
#bat = await asyncio.to_thread(tello.get_battery)
logger.info(f"\n\nDEBUG RESPONSE: \n** -> {response}")
resp_cmd = await asyncio.to_thread(tello.send_command_with_return, "command", 3)
if "Aborting command" in resp_cmd:
logger.warning("no tello responded")
else:
bat = await asyncio.to_thread(tello.get_battery)
logger.success(f"tello exists: {bat}")
counter += 1
await asyncio.sleep(1.001)