Improve the dahboard with the weather info 2

This commit is contained in:
Urtzi Alfaro
2025-08-18 13:53:27 +02:00
parent afca94dadd
commit 0a42fe628c
8 changed files with 164 additions and 61 deletions

View File

@@ -55,8 +55,8 @@ async def get_current_traffic(
# Continue processing - event publishing failure shouldn't break the API
logger.debug("Successfully returning traffic data",
volume=traffic.traffic_volume,
congestion=traffic.congestion_level)
volume=traffic.get('traffic_volume') if isinstance(traffic, dict) else getattr(traffic, 'traffic_volume', None),
congestion=traffic.get('congestion_level') if isinstance(traffic, dict) else getattr(traffic, 'congestion_level', None))
return traffic
except HTTPException: