feat: 워치 스킨 가운데를 날씨 따라 비구름·천둥 구름·눈구름으로 — 초단기예보 낙뢰(LGT)로 2시간 안 천둥을 워치에 알림

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
HyeongBaeYangandClaude Opus 5.5 committed 2026-10-13 11:00:39 +09:00
1 parent a74e3b49d0
commit c0e0363759
10 files changed
+236 -37

No files matched your search

+11 -1
View File
@@ -18,7 +18,7 @@ def test_parse_ultra_reads_rain_and_temp():
{"category": c, "fcstDate": "20261002", "fcstTime": "1000", "fcstValue": v}
for c, v in [("PTY", "1"), ("RN1", "1mm 미만"), ("T1H", "17")]
]
assert parse_ultra(items) == [{"at": _kst(2, 10), "rain_type": RainType.RAIN, "rain_mm": 0.5, "temp_c": 17.0}]
assert parse_ultra(items) == [{"at": _kst(2, 10), "rain_type": RainType.RAIN, "rain_mm": 0.5, "temp_c": 17.0, "lightning": False}]
def _event(area, var, cmd, tm, seq=1, stress=0):
@@ -82,3 +82,13 @@ def test_parse_ultra_reads_drizzle_codes():
for c, v in [("PTY", pty), ("RN1", "1mm 미만"), ("T1H", "17")]
]
assert [p["rain_type"] for p in parse_ultra(items)] == [RainType.RAIN, RainType.SLEET, RainType.SNOW]
def test_parse_ultra_reads_lightning():
"""LGT 는 낙뢰(kA). 0 이면 없음, 칸이 없어도 없음."""
items = [
{"fcstDate": "20261013", "fcstTime": f"{h:02d}00", "category": c, "fcstValue": v}
for h, lgt in ((10, "0"), (11, "3"), (12, None))
for c, v in [("PTY", "1"), ("RN1", "5.0mm"), ("T1H", "17"), ("LGT", lgt)] if v is not None
]
assert [p["lightning"] for p in parse_ultra(items)] == [False, True, False]