From 7f48e0d4fe006955df928b3c0430d38ebf0be1ba Mon Sep 17 00:00:00 2001 From: Ayan Shafqat Date: Thu, 23 May 2024 08:47:45 -0400 Subject: [PATCH] Add single line output code for WeatherCode #995 --- lib/view/line.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/view/line.py b/lib/view/line.py index 1198a5d..230916e 100644 --- a/lib/view/line.py +++ b/lib/view/line.py @@ -128,6 +128,12 @@ def render_condition_plain(data, query): return weather_condition +def render_condition_int(data, query): + """Weather condition code as integer (i) + """ + return data['weatherCode'] + + def render_humidity(data, query): """ humidity (h) @@ -284,6 +290,7 @@ FORMAT_SYMBOL = { 'c': render_condition, 'C': render_condition_fullname, 'x': render_condition_plain, + 'i': render_condition_int, 'h': render_humidity, 't': render_temperature, 'f': render_feel_like_temperature,