From 2d4f945c6ffb850e21d3f2d24dc25087a207068d Mon Sep 17 00:00:00 2001 From: prabinpanta0 Date: Mon, 27 Oct 2025 12:22:12 +0545 Subject: config(hypr): preserve valid zero values for is_day and weather_code by using explicit None checks --- config/hypr/UserScripts/Weather.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'config/hypr/UserScripts/Weather.py') diff --git a/config/hypr/UserScripts/Weather.py b/config/hypr/UserScripts/Weather.py index c7638599..4c64221f 100755 --- a/config/hypr/UserScripts/Weather.py +++ b/config/hypr/UserScripts/Weather.py @@ -595,9 +595,11 @@ def build_weather_strings(cur: JSONDict, cur_units: JSONDict, daily: JSONDict, d feels_str = f"Feels like {int(round(feels_val))}{feels_unit}" if feels_val is not None else "" is_day_val = cur.get("is_day") - is_day = coerce_int(is_day_val) or 1 + is_day_int = coerce_int(is_day_val) + is_day = is_day_int if is_day_int is not None else 1 weather_code_val = cur.get("weather_code") - code = coerce_int(weather_code_val) or -1 + code_int = coerce_int(weather_code_val) + code = code_int if code_int is not None else -1 icon = wmo_to_icon(code, is_day) status = wmo_to_status(code) -- cgit v1.2.3