diff --git a/data/weather.py b/data/weather.py index edb2bdf..4882bbe 100644 --- a/data/weather.py +++ b/data/weather.py @@ -39,26 +39,29 @@ def get_precipitation_summary(retry=True): total_rainfall = 0.0 lines = [ - '
', - '

[시간대별 강수량]

', - '', + '
', + '

[시간대별 강수량]

', + '
', + '', '', - '', - '', - '' + '', + '', + '', + '', + '' ] for item in data['response']['body']['items']['item']: if item['category'] == 'PCP' and item['fcstDate'] == TODAY: - time = item['fcstTime'] # 예: '1100' + time = item['fcstTime'] if 900 < int(time) < 2300: mm = parse_precip(item['fcstValue']) - time_str = f"{time[:2]}:{time[2:]}" # '11:00' - lines.append(f'') + time_str = f"{time[:2]}:{time[2:]}" + lines.append(f'') total_rainfall += mm - lines.append(f'') - lines.append('
시간강수량
시간강수량
{time_str}{mm}mm
{time_str}{mm}mm
영업시간 중 총 예상 강수량: {total_rainfall:.1f}mm
') + lines.append(f'영업시간 중 총 예상 강수량: {total_rainfall:.1f}mm') + lines.append('') return ''.join(lines)