机场温度取值增加 METAR 兜底:避免高频源不可用时出现空行
当 KNMI/FMI/JMA/MGM 数据未就绪时回退到 current.temp, 确保消息至少显示一个温度值而非空白。 Constraint: 兜底温度为 METAR 整数精度,待高频源恢复后自动切回小数 Tested: ruff check 通过
This commit is contained in:
@@ -752,6 +752,10 @@ 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
|
||||
# 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, ""]
|
||||
if runway_pairs and runway_temps and len(runway_pairs) == len(runway_temps):
|
||||
|
||||
Reference in New Issue
Block a user