localization
This commit is contained in:
@@ -1,15 +1,15 @@
|
||||
#pragma once
|
||||
#include <Arduino.h>
|
||||
|
||||
// Sehr einfache Wetteranzeige (Icon im Header, dort wo frueher der
|
||||
// Cam-Button war) - fragt periodisch die aktuelle Wetterlage fuer den
|
||||
// gerade aktiven Standort ab (also inkl. aktivem Standort-Preset, siehe
|
||||
// LocationManager::getHomeLocation() - wenn dort z.B. Mailand ausgewaehlt
|
||||
// ist, zeigt das Icon das Wetter in Mailand). Nutzt die kostenlose
|
||||
// Open-Meteo-API (kein API-Key noetig).
|
||||
// Very simple weather display (icon in the header, where the camera button
|
||||
// used to be) - periodically queries the current weather for the currently
|
||||
// active location (including active location preset, see
|
||||
// LocationManager::getHomeLocation() - if e.g. Milan is selected there,
|
||||
// the icon shows the weather in Milan). Uses the free Open-Meteo API (no
|
||||
// API key needed).
|
||||
namespace Weather {
|
||||
enum class Condition {
|
||||
Unknown, // noch keine erfolgreiche Abfrage - Icon zeigt nichts an
|
||||
Unknown, // no successful query yet - icon shows nothing
|
||||
Clear,
|
||||
PartlyCloudy,
|
||||
Cloudy,
|
||||
@@ -18,16 +18,14 @@ namespace Weather {
|
||||
Thunderstorm
|
||||
};
|
||||
|
||||
// Muss regelmaessig aus dem NetTask (Core 0) aufgerufen werden - kuemmert
|
||||
// sich intern um das Abfrage-Intervall (Config::WEATHER_FETCH_INTERVAL_MS)
|
||||
// und erkennt eine Standort-Aenderung (z.B. anderes aktives Preset), um
|
||||
// dann sofort neu abzufragen statt bis zum naechsten reguleren Intervall
|
||||
// zu warten.
|
||||
// Must be called regularly from NetTask (Core 0) - handles the query
|
||||
// interval internally (Config::WEATHER_FETCH_INTERVAL_MS) and detects
|
||||
// location changes (e.g. different active preset) to immediately re-query
|
||||
// instead of waiting for the next regular interval.
|
||||
void update();
|
||||
|
||||
// Aktuell bekannte Wetterlage, threadsicher genug fuer diesen Zweck (ein
|
||||
// einzelnes uint8-artiges Enum, das nur vom NetTask geschrieben und vom
|
||||
// UI-Thread gelesen wird - kein Lock noetig, ein kurzfristig veraltetes
|
||||
// Lesen ist unkritisch).
|
||||
// Currently known weather condition, thread-safe enough for this purpose (a
|
||||
// single uint8-like enum, only written by NetTask and read by the UI thread
|
||||
// - no lock needed, a briefly stale read is harmless).
|
||||
Condition current();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user