v2.8.0: Weather icon in header
Adds a small weather icon in the header, right where the old camera button used to be. Shows current conditions (sun, cloud, sun-behind-cloud, rain, snow, thunderstorm) for whichever location is currently active, including active location presets, so switching to e.g. Milan shows Milan's weather. Powered by the free Open-Meteo API (no API key needed), refreshed automatically every 10 minutes in the background, or immediately after switching to a different location preset. Icons are drawn entirely with TFT_eSPI basic shapes (circles, lines), no image files or extra fonts needed. The initial implementation failed to parse Open-Meteo's response (ArduinoJson "InvalidInput") because the API replies with Transfer-Encoding: chunked and streaming directly from http.getStream() didn't reassemble the chunks correctly. Fixed by collecting the full body via http.getString() first, then parsing that. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -6,7 +6,7 @@ namespace Config {
|
||||
// CLAUDE.md-Workflow "Standard-Workflow: Push & Release") - erscheint
|
||||
// im Info-Screen (Menue > System > Info) und muss zum jeweiligen
|
||||
// Git-Tag passen.
|
||||
constexpr const char* APP_VERSION = "2.7.5";
|
||||
constexpr const char* APP_VERSION = "2.8.0";
|
||||
|
||||
// Display-Helligkeit (Menue > System > Helligkeit), in Prozent.
|
||||
// MIN bewusst nicht 0 - ein komplett dunkles Display koennte sonst wie
|
||||
@@ -40,6 +40,12 @@ namespace Config {
|
||||
constexpr uint32_t FETCH_INTERVAL_MS = 8000;
|
||||
constexpr uint32_t HTTP_TIMEOUT_MS = 6000;
|
||||
|
||||
// Wetter-Icon im Header (siehe weather.cpp) - deutlich seltener
|
||||
// abgefragt als die ADS-B-Daten, das Wetter aendert sich nicht
|
||||
// minuetlich und die kostenlose Open-Meteo-API soll nicht unnoetig oft
|
||||
// belastet werden.
|
||||
constexpr uint32_t WEATHER_FETCH_INTERVAL_MS = 600000; // 10 Minuten
|
||||
|
||||
constexpr float DEFAULT_PROXIMITY_ALERT_KM = 8.0f;
|
||||
|
||||
constexpr float LED_ALERT_RADIUS_KM = 3.0f;
|
||||
|
||||
Reference in New Issue
Block a user