mirror of
https://github.com/skoelle/wt32sc01-dashboard.git
synced 2026-09-18 09:50:25 +00:00
Phase 0/2: API layer kept 1:1, only secrets.h include path fixed
http_client/weather_api/calendar_api/departures_api are hardware- independent (HTTP GET + ArduinoJson parsing, same endpoints, same JSON). Kept verbatim per PLAN.md migration strategy; only changed #include "../../include/secrets.h" -> #include <secrets.h> to match the PlatformIO include/ layout (no functional change).
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
#pragma once
|
||||
#include <Arduino.h>
|
||||
#include <vector>
|
||||
|
||||
struct WeatherCurrent {
|
||||
int temperature = 0;
|
||||
String symbol;
|
||||
String description;
|
||||
};
|
||||
|
||||
struct ForecastEntry {
|
||||
String time;
|
||||
int temperature = 0;
|
||||
String symbol;
|
||||
String description;
|
||||
float precipitationProbability = 0.0f;
|
||||
String precipitationType;
|
||||
};
|
||||
|
||||
struct WeatherData {
|
||||
bool valid = false;
|
||||
WeatherCurrent current;
|
||||
std::vector<ForecastEntry> forecast;
|
||||
};
|
||||
|
||||
WeatherData fetchWeather();
|
||||
bool willRainSoon(const WeatherData &data, int hours = 8);
|
||||
Reference in New Issue
Block a user