Skip to content

Commit

Permalink
fix type
Browse files Browse the repository at this point in the history
  • Loading branch information
motty-mio2 committed Nov 18, 2023
1 parent 8ba64e7 commit 4ace1e8
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions src/kb_2315/backend/weather/code2icon.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,38 +4,38 @@ def weather_code2icon(weather_code: int) -> str:
https://open-meteo.com/en/docs
https://www.jodc.go.jp/data_format/weather-code_j.html#:~:text=%E7%8F%BE%E5%9C%A8%E5%A4%A9%E5%80%99(Present%20Weather)%20(WMO%20Code%204677)
"""
if weather_code in ["0", "1"]:
if weather_code in [0, 1]:
# 晴れ
return "☀"

elif weather_code in ["2", "3"]:
elif weather_code in [2, 3]:
# 曇り
return "☁"

elif weather_code in [
# 雨
"45",
"48",
"51",
"53",
"55",
"56",
"57",
"61",
"63",
"65",
"66",
"67",
"80",
"81",
"82",
"95",
"96",
"99",
45,
48,
51,
53,
55,
56,
57,
61,
63,
65,
66,
67,
80,
81,
82,
95,
96,
99,
]:
return "🌧"

elif weather_code in ["71", "73", "75", "77", "85", "86"]:
elif weather_code in [71, 73, 75, 77, 85, 86]:
# 雪
return "🌨"

Expand Down

0 comments on commit 4ace1e8

Please sign in to comment.