From f7a453e39bebe65811ad0a460405911e6009ea27 Mon Sep 17 00:00:00 2001 From: "2569718930@qq.com" <2569718930@qq.com> Date: Tue, 12 May 2026 21:04:48 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9C=BA=E5=9C=BA=E6=B6=88=E6=81=AF=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E5=BD=93=E6=97=A5=E5=B7=B2=E5=87=BA=E7=8E=B0=E6=9C=80?= =?UTF-8?q?=E9=AB=98=E6=B8=A9=E5=8F=8A=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 每城显示三行:当前温度、日内最高+时间、DEB 预测。 所有六城统一格式。 Tested: pytest 176 passed, ruff check 通过 --- src/utils/telegram_push.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/utils/telegram_push.py b/src/utils/telegram_push.py index ddd58091..ed9268eb 100644 --- a/src/utils/telegram_push.py +++ b/src/utils/telegram_push.py @@ -752,9 +752,9 @@ def _build_airport_status_message( if not airport_row: airport_row = mgm_nearby[0] if mgm_nearby else {} station_temp = airport_row.get("temp") if airport_row else None + current = city_weather.get("current") or {} # Fallback to city current temp if airport station not found if station_temp is None: - current = city_weather.get("current") or {} station_temp = current.get("temp") lines = [header, ""] @@ -763,8 +763,14 @@ def _build_airport_status_message( lines.append(f"{r1}/{r2} {t:.1f}°C") elif station_temp is not None: lines.append(f"{station_temp:.1f}°C") + # Today's observed high + max_so_far = current.get("max_so_far") + max_temp_time = current.get("max_temp_time") + 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}") if deb_pred is not None: - lines.append(f"DEB 最高 {deb_pred:.1f}°C") + lines.append(f"DEB 预测 {deb_pred:.1f}°C") return "\n".join(lines)