Compare commits
No commits in common. "a6dbb94d909793587d566dfc63aa1b4a5293a11b" and "0807c15de4f4cbb5dee8805d57f12a195d618849" have entirely different histories.
a6dbb94d90
...
0807c15de4
2 changed files with 1 additions and 18 deletions
|
@ -1,17 +0,0 @@
|
||||||
use super::data::WeatherData;
|
|
||||||
use super::secret::API_TOKEN;
|
|
||||||
|
|
||||||
|
|
||||||
pub fn get_weather_data() -> reqwest::Result<WeatherData> {
|
|
||||||
let api_url = format!(
|
|
||||||
"https://api.openweathermap.org/data/3.0/onecall?units={units}&lat={lat}&lon={lon}&exclude={exclude}&lang={lang}&appid={token}",
|
|
||||||
units = "metric",
|
|
||||||
lat = 51.03866,
|
|
||||||
lon = 13.70031,
|
|
||||||
exclude = "minutely",
|
|
||||||
lang = "de",
|
|
||||||
token = API_TOKEN,
|
|
||||||
);
|
|
||||||
|
|
||||||
reqwest::blocking::get(dbg!(api_url))?.json()
|
|
||||||
}
|
|
|
@ -145,7 +145,7 @@ pub struct WeatherAlert {
|
||||||
pub struct Precipitation {
|
pub struct Precipitation {
|
||||||
/// Precipitation volume in the last hour in mm
|
/// Precipitation volume in the last hour in mm
|
||||||
#[serde(rename = "1h")]
|
#[serde(rename = "1h")]
|
||||||
pub(self) hour: f32,
|
pub(self) hour: u16,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Deserialize)]
|
#[derive(Deserialize)]
|
||||||
|
|
Loading…
Reference in a new issue