From 7084bdf1ec68eda0f95f6f7ea9c3de3441b6a192 Mon Sep 17 00:00:00 2001 From: "2569718930@qq.com" <2569718930@qq.com> Date: Wed, 13 May 2026 00:07:46 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=A6=96=E5=B0=94/=E9=87=9C?= =?UTF-8?q?=E5=B1=B1=E8=B7=91=E9=81=93=E6=B8=A9=E5=BA=A6=E5=81=B6=E5=8F=91?= =?UTF-8?q?=E4=B8=8D=E5=B1=95=E7=A4=BA=EF=BC=9A=E8=BF=87=E6=BB=A4=20None?= =?UTF-8?q?=20=E5=80=BC=E5=B9=B6=E5=A2=9E=E5=8A=A0=E5=9B=9E=E9=80=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit AMOS 部分跑道对温度可能为 None(传感器暂时不可用), 之前直接 format None 导致静默跳过整组跑道显示。 改为只展示有效跑道对,全部不可用时回退到当前实测。 Tested: pytest 176 passed, AMOS 实测 runway_pairs=4 temperatures 2/4 valid --- src/utils/telegram_push.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/utils/telegram_push.py b/src/utils/telegram_push.py index 43440f26..7ddc3cb8 100644 --- a/src/utils/telegram_push.py +++ b/src/utils/telegram_push.py @@ -776,10 +776,13 @@ def _build_airport_status_message( station_temp = current.get("temp") lines = [header, ""] + 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): - lines.append(f"{r1}/{r2} {t:.1f}°C") - elif station_temp is not None: + if t is not None: + lines.append(f"{r1}/{r2} {t:.1f}°C") + runway_shown = True + if not runway_shown and station_temp is not None: label = "AROME预报" if city == "paris" else "当前实测" lines.append(f"{label}:{station_temp:.1f}°C") if deb_pred is not None: