mirror of
https://github.com/ajnart/homarr.git
synced 2025-11-15 09:46:19 +01:00
Middleware didn't work in v12.2.3. Hopefully the password protection will work again now.
42 lines
916 B
TypeScript
42 lines
916 B
TypeScript
// To parse this data:
|
|
//
|
|
// import { Convert, WeatherResponse } from "./file";
|
|
//
|
|
// const weatherResponse = Convert.toWeatherResponse(json);
|
|
//
|
|
// These functions will throw an error if the JSON doesn't
|
|
// match the expected interface, even if the JSON is valid.
|
|
|
|
export interface WeatherResponse {
|
|
current_weather: CurrentWeather;
|
|
utc_offset_seconds: number;
|
|
latitude: number;
|
|
elevation: number;
|
|
longitude: number;
|
|
generationtime_ms: number;
|
|
daily_units: DailyUnits;
|
|
daily: Daily;
|
|
}
|
|
|
|
export interface CurrentWeather {
|
|
winddirection: number;
|
|
windspeed: number;
|
|
time: string;
|
|
weathercode: number;
|
|
temperature: number;
|
|
}
|
|
|
|
export interface Daily {
|
|
temperature_2m_max: number[];
|
|
time: Date[];
|
|
temperature_2m_min: number[];
|
|
weathercode: number[];
|
|
}
|
|
|
|
export interface DailyUnits {
|
|
temperature_2m_max: string;
|
|
temperature_2m_min: string;
|
|
time: string;
|
|
weathercode: string;
|
|
}
|