diff options
| author | prabinpanta0 <pantaprabin30@gmail.com> | 2025-10-27 12:22:12 +0545 |
|---|---|---|
| committer | prabinpanta0 <pantaprabin30@gmail.com> | 2025-10-27 12:22:12 +0545 |
| commit | 2d4f945c6ffb850e21d3f2d24dc25087a207068d (patch) | |
| tree | 7d420ab7f097852157220eddf88c6d7123b5ab58 /config | |
| parent | 94e1d96814cdaf41da1f4129f6a01447bd771af6 (diff) | |
config(hypr): preserve valid zero values for is_day and weather_code by using explicit None checks
Diffstat (limited to 'config')
| -rwxr-xr-x | config/hypr/UserScripts/Weather.py | 6 |
1 files changed, 4 insertions, 2 deletions
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) |
