Reduce API load: fewer frames, 10min refresh, 5s startup delay

This commit is contained in:
Clawd
2026-02-11 14:46:53 +00:00
parent 3d37c31ab6
commit 319ae80d8e

View File

@@ -30,13 +30,16 @@ Module.register("MMM-CombinedMap", {
radarOpacity: 0.7,
trafficOpacity: 0.7,
// Radar frames
historyFrames: 12, // 1 hour of history (5 min intervals)
forecastFrames: 24, // 2 hours of forecast
// Radar frames (reduced to limit API load)
historyFrames: 6, // 30 min of history (5 min intervals)
forecastFrames: 12, // 1 hour of forecast
extraDelayLastFrame: 2000, // Extra delay on last frame
// Update interval (ms) - how often to refresh radar data
updateInterval: 5 * 60 * 1000, // 5 minutes
updateInterval: 10 * 60 * 1000, // 10 minutes
// Startup delay to avoid hammering API on restarts
startupDelay: 5000, // 5 seconds
},
getStyles: function() {
@@ -121,9 +124,9 @@ Module.register("MMM-CombinedMap", {
this.addTrafficLayer();
}
// Radar layer (DWD)
// Radar layer (DWD) - delayed start to avoid API hammering
if (this.config.showRadar) {
this.fetchRadarCapabilities();
setTimeout(() => this.fetchRadarCapabilities(), this.config.startupDelay);
}
// Marker
@@ -435,11 +438,11 @@ Module.register("MMM-CombinedMap", {
// Labels for start/end
const startLabel = document.createElement("div");
startLabel.className = "timeline-label timeline-start";
startLabel.textContent = "-1h";
startLabel.textContent = "-30m";
const endLabel = document.createElement("div");
endLabel.className = "timeline-label timeline-end";
endLabel.textContent = "+2h";
endLabel.textContent = "+1h";
track.appendChild(past);
track.appendChild(future);