fix: read temp_unit from briefing_config not a nonexistent temperature_unit setting

This commit is contained in:
2026-03-28 12:49:36 -04:00
parent 96a07690a8
commit 7b95150101
+9 -1
View File
@@ -130,7 +130,15 @@ async def recent_items():
@_REQUIRE
async def get_weather():
rows = await weather_svc.get_cached_weather_rows(g.user.id)
temp_unit = await get_setting(g.user.id, "temperature_unit", "C")
import json as _json
raw = await get_setting(g.user.id, "briefing_config", "{}")
try:
_cfg = _json.loads(raw) if isinstance(raw, str) else (raw or {})
temp_unit = _cfg.get("temp_unit", "C")
if temp_unit not in ("C", "F"):
temp_unit = "C"
except Exception:
temp_unit = "C"
cards = [
card for row in rows
if (card := weather_svc.parse_weather_card_data(row, temp_unit)) is not None