From cad0bef8714396ef062697854063150797d45bfe Mon Sep 17 00:00:00 2001 From: Sieren Date: Fri, 10 Sep 2021 19:30:10 +0200 Subject: [PATCH] Flush output when observing Ensure we flush the output when observing so piping the output into tools (like jq) works on each message. --- aioairctrl/cli.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aioairctrl/cli.py b/aioairctrl/cli.py index 4951710..4b3a8ce 100644 --- a/aioairctrl/cli.py +++ b/aioairctrl/cli.py @@ -2,6 +2,7 @@ import asyncio import json import logging +import sys from aioairctrl import CoAPClient @@ -106,6 +107,7 @@ async def async_main() -> None: print(json.dumps(status)) else: print(status) + sys.stdout.flush() elif args.command == "set": data = {} for e in args.values: