From 9adcfdb20329660394531bb43e8d23eb3238902f Mon Sep 17 00:00:00 2001 From: "2569718930@qq.com" <2569718930@qq.com> Date: Wed, 13 May 2026 01:13:07 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=BE=E5=AE=BD=E6=97=B6=E9=97=B4=E7=AA=97?= =?UTF-8?q?=E5=8F=A3=EF=BC=9Apeak-4h=20=E5=88=B0=20peak+2h=EF=BC=886?= =?UTF-8?q?=E5=B0=8F=E6=97=B6=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/telegram_push.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/utils/telegram_push.py b/src/utils/telegram_push.py index 129abefa..dca46e66 100644 --- a/src/utils/telegram_push.py +++ b/src/utils/telegram_push.py @@ -863,9 +863,9 @@ def _in_peak_time_window(city_weather: Dict[str, Any]) -> bool: try: current_h, current_m = int(local_time[:2]), int(local_time[3:5]) current_minutes = current_h * 60 + current_m - # Window: first_h - 2h to last_h + 1.5h - start_min = max(0, (first_h - 2) * 60) - end_min = min(24 * 60 - 1, int((last_h + 1.5) * 60)) + # Window: first_h - 4h to last_h + 2h + start_min = max(0, (first_h - 4) * 60) + end_min = min(24 * 60 - 1, (last_h + 2) * 60) return start_min <= current_minutes <= end_min except Exception: return False