From 8a8a47e31d7651bef1ff465b1e1581cf9d98f9a7 Mon Sep 17 00:00:00 2001 From: "2569718930@qq.com" <2569718930@qq.com> Date: Wed, 13 May 2026 00:38:05 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A6=96=E5=B0=94=E9=87=9C=E5=B1=B1=E6=94=B9?= =?UTF-8?q?=E4=B8=BA10=E5=88=86=E9=92=9F=E6=8E=A8=E9=80=81=EF=BC=9B?= =?UTF-8?q?=E5=BD=93=E5=89=8D=E6=B8=A9=E5=BA=A6=E7=A0=B4=E6=97=A5=E9=AB=98?= =?UTF-8?q?=E6=97=B6=E5=8A=A0=E6=96=B0=E9=AB=98=E6=A0=87=E8=AE=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit AMOS 1分钟数据改为每10分钟推送一次避免刷屏。 当当前温度超过今日实测最高≥0.3°C时,标题行追加🔶新高标记。 --- src/utils/telegram_push.py | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/src/utils/telegram_push.py b/src/utils/telegram_push.py index 88a7ed98..ed818d5f 100644 --- a/src/utils/telegram_push.py +++ b/src/utils/telegram_push.py @@ -776,7 +776,20 @@ def _build_airport_status_message( if station_temp is None: station_temp = current.get("temp") - lines = [header, ""] + # Determine current max temp for new-high check + latest_temp = station_temp + if runway_temps: + valid = [t for (t, _d) in runway_temps if t is not None] + if valid: + latest_temp = max(valid) + + # Check if breaking today's high + max_so_far, max_temp_time = _get_airport_daily_high(city_weather) + new_high = (latest_temp is not None and max_so_far is not None + and latest_temp - max_so_far >= 0.3) + + flag = " \U0001f536新" if new_high else "" + lines = [header + flag, ""] runway_shown = False if runway_pairs and runway_temps and len(runway_pairs) == len(runway_temps): for (r1, r2), (t, _d) in zip(runway_pairs, runway_temps): @@ -788,7 +801,6 @@ def _build_airport_status_message( lines.append(f"{label}:{station_temp:.1f}°C") if deb_pred is not None: lines.append(f"今日DEB预报最高:{deb_pred:.1f}°C") - max_so_far, max_temp_time = _get_airport_daily_high(city_weather) if max_so_far is not None: time_str = f"({max_temp_time})" if max_temp_time else "" lines.append(f"今日实测最高:{max_so_far:.1f}°C{time_str}") @@ -810,8 +822,8 @@ def _get_airport_daily_high(city_weather: Dict[str, Any]): # Per-city push interval matching native data refresh rate (seconds) _AIRPORT_PUSH_INTERVAL = { - "seoul": 60, # AMOS 1-min - "busan": 60, # AMOS 1-min + "seoul": 600, # AMOS 1-min → 10min push + "busan": 600, # AMOS 1-min → 10min push "tokyo": 600, # JMA 10-min "ankara": 600, # MGM ~10-min "helsinki": 600, # FMI 10-min