接入台北松山 RCSS CWA 10分钟实时温度;HKO 显示结算温度
台北通过现有 CWA 开放数据 API(站号 466920)接入高频推送。 香港/流浮山消息新增"结算温度"行,显示向下取整后的结算值。 Tested: pytest 176 passed, ruff check 通过
This commit is contained in:
@@ -365,6 +365,18 @@ class SettlementSourceMixin:
|
||||
"unit": "celsius",
|
||||
}
|
||||
self._set_settlement_cache(cache_key, payload)
|
||||
# Write to airport obs log for high-freq monitoring
|
||||
try:
|
||||
from src.database.db_manager import DBManager
|
||||
DBManager().append_airport_obs(
|
||||
icao="466920",
|
||||
city="taipei",
|
||||
temp_c=payload["current"]["temp"],
|
||||
wind_kt=payload["current"].get("wind_speed_kt"),
|
||||
obs_time=str(obs_time_raw or "").strip() or datetime.now().isoformat(),
|
||||
)
|
||||
except Exception:
|
||||
logger.exception("airport_obs_log append failed for cwa")
|
||||
return payload
|
||||
except Exception as exc:
|
||||
logger.warning(f"CWA settlement fetch failed: {exc}")
|
||||
|
||||
Reference in New Issue
Block a user