i3-companion: avoid invoking bluetooth_status() without creating a task

This commit is contained in:
Vincent Bernat 2022-03-26 20:42:26 +01:00
parent 14604234f1
commit 6e7d529abf

View file

@ -860,7 +860,8 @@ async def bluetooth_status(i3, event, *args):
output[-1] = f"{output[-1]},{icon}" output[-1] = f"{output[-1]},{icon}"
# Schedule a refresh in 5 minutes # Schedule a refresh in 5 minutes
bluetooth_status.scheduled = loop.call_later( bluetooth_status.scheduled = loop.call_later(
600, asyncio.create_task, bluetooth_status(i3, StartEvent) 600,
lambda: asyncio.create_task(bluetooth_status(i3, StartEvent)),
) )
except Exception as exc: except Exception as exc:
logger.info("cannot get battery status: %s", exc) logger.info("cannot get battery status: %s", exc)