fix: 오늘의 각 줄 날씨가 지금 시각이 아니라 남은 구간 가운데 시각(4시 10분인데 '오후 5시')으로 보이던 것 — 지금 구간은 지금 시각 날씨로
This commit is contained in:
1 parent
e0c3cbf6ea
commit
751beb6e33
3 files changed
+20
-4
No files matched your search
@@ -295,7 +295,11 @@ _SKY_WORD = {Sky.CLEAR: "맑음", Sky.PARTLY: "구름 많음", Sky.CLOUDY: "흐
|
||||
|
||||
|
||||
def _summary(hours: list[Hour]) -> str:
|
||||
mid = hours[len(hours) // 2]
|
||||
return summary_line(hours[len(hours) // 2])
|
||||
|
||||
|
||||
def summary_line(mid: Hour) -> str:
|
||||
"""그 시각 날씨 한 줄 (오후 5시 13°, 비 60%)."""
|
||||
wind = mid.wind_ms
|
||||
tag = f"비 {mid.rain_prob}%" if mid.rain_prob >= 50 else (
|
||||
"바람 살랑" if wind is not None and wind <= 2 else "바람 조금" if wind is not None and wind <= 5 else "바람 강함" if wind is not None else _SKY_WORD[mid.sky]
|
||||
|
||||
Reference in new issue
Block a user