From d9ab8d9d965c2395c1b9d8fac4dba3a0871eca3e Mon Sep 17 00:00:00 2001 From: Andreas Thienemann Date: Sat, 26 Feb 2022 17:55:47 +0100 Subject: [PATCH] debug output als json --- app.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app.py b/app.py index cea1c2b..c37eef2 100755 --- a/app.py +++ b/app.py @@ -5,7 +5,7 @@ from flask_bootstrap import Bootstrap from flask_nav import Nav from flask_nav.elements import Navbar, View, Subgroup, Link, Text, Separator from sml_decoder import TasmotaSMLParser -from pprint import pprint +import json app = Flask(__name__) Bootstrap(app) @@ -37,7 +37,7 @@ def decode(): messages.append({"msg": details, "tas": tasmota_script}) messages = sorted(messages, key=lambda x: x["msg"]["obis"]) - pprint(messages) + print(json.dumps(messages)) return render_template( "decode.html",