refactor(modules): simplify SVG asset handling across modules

Enhancements:
- Add optimized night‑variant detection for weather icons using a predefined list
- Replace `Svg` usage with direct `svg_file` calls throughout the todo widget, removing redundant relative‑path logic
- Update dock and battery modules to load assets via direct paths, eliminating unnecessary `get_relative_path` calls- Introduce `WEATHER_CACHE_TIMEOUT` constant and tidy up unused imports (`WEATHER_EMOJI_MAP` removed)
- Minor formatting and structural clean‑ups that improve code readability

Bug Fixes:
- Remove dead import of `WEATHER_EMOJI_MAP` and unused constant `WEATHER_EMOJI_MAP`
- Correct syntax of `condition_em` initialization to avoid potential rendering issues

New Features:
- None.
This commit is contained in:
sankalp committed 2026-04-02 23:13:47 +05:45
1 parent 017c127a44
commit c22ea5dfda
10 files changed
+60 -79

No files matched your search

+1 -1
View File
@@ -31,7 +31,7 @@ def get_battery_icon_file(
clamped = max(0, min(100, percentage))
step = (clamped // 10) * 10
filename = f"battery-{step:03d}{'-charging' if is_charging else ''}.svg"
return svg_file(f"battery/{filename}")
return f"battery/{filename}"
def set_bluetooth_enabled_with_fallback(client, enabled: bool):