From 4f7b182e4c98e041ac82e746404ca7ad5692bc36 Mon Sep 17 00:00:00 2001 From: Igor Chubin Date: Mon, 1 Nov 2021 11:13:00 +0100 Subject: [PATCH] Add j2 view (#661) --- lib/view/line.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/view/line.py b/lib/view/line.py index 61a0900..525614d 100644 --- a/lib/view/line.py +++ b/lib/view/line.py @@ -359,7 +359,10 @@ def format_weather_data(query, parsed_query, data): if format_line in PRECONFIGURED_FORMAT: format_line = PRECONFIGURED_FORMAT[format_line] - if format_line == "j1": + if format_line in ["j1", "j2"]: + # j2 is a lightweight j1, without 'weather' (weather forecast) + if "weather" in data["data"] and format_line == "j2": + del data["data"]["weather"] return render_json(data['data']) if format_line == "p1": return prometheus.render_prometheus(data['data'])