From 83d2de5438c4942fd9e434953b6030fca21f0683 Mon Sep 17 00:00:00 2001 From: "2569718930@qq.com" <2569718930@qq.com> Date: Tue, 12 May 2026 20:17:32 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=9D=9E=20AMOS=20=E5=9F=8E?= =?UTF-8?q?=E5=B8=82=E6=B8=A9=E5=BA=A6=E6=98=BE=E7=A4=BA=E4=B8=BA=E6=95=B4?= =?UTF-8?q?=E6=95=B0=EF=BC=9A=E6=94=B9=E7=94=A8=E6=9C=BA=E5=9C=BA=E7=AB=99?= =?UTF-8?q?=E7=82=B9=E6=B8=A9=E5=BA=A6=E6=9B=BF=E4=BB=A3=20METAR?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit city_weather.current.temp 来自 METAR(整数),改为从 mgm_nearby[0].temp 取机场高频数据源的站点温度(小数精度)。JMA/FMI/KNMI/MGM 源均保留一位小数。 Constraint: 首尔/釜山走 runway_temps 已有精度,不受影响 Tested: pytest 176 passed, ruff check 通过 --- src/utils/telegram_push.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/utils/telegram_push.py b/src/utils/telegram_push.py index 0e723b0a..26a9eeb4 100644 --- a/src/utils/telegram_push.py +++ b/src/utils/telegram_push.py @@ -737,16 +737,17 @@ def _build_airport_status_message( runway_data = (amos.get("runway_obs") or {}) if amos else {} runway_pairs = runway_data.get("runway_pairs") or [] runway_temps = runway_data.get("temperatures") or [] - current = city_weather.get("current") or {} - temp = current.get("temp") + # Non-AMOS cities: get temp from airport station (stored in mgm_nearby), not METAR + mgm_nearby = city_weather.get("mgm_nearby") or [] + station_temp = mgm_nearby[0].get("temp") if mgm_nearby else None lines = [label, ""] 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 temp is not None: + elif station_temp is not None: time_suffix = f" ({local_time})" if local_time else "" - lines.append(f"{temp:.1f}°C{time_suffix}") + lines.append(f"{station_temp:.1f}°C{time_suffix}") if deb_pred is not None: lines.append(f"DEB 最高 {deb_pred:.1f}°C") return "\n".join(lines)