Adding SpeedUnit and TempUnit
This commit is contained in:
+10
-4
@@ -1,12 +1,13 @@
|
||||
mod cli;
|
||||
mod coords;
|
||||
|
||||
mod current_weather_print_params;
|
||||
mod current_weather;
|
||||
mod current_weather_print_params;
|
||||
mod current_weather_printer;
|
||||
mod ifconfig;
|
||||
mod ip_api;
|
||||
mod open_meteo;
|
||||
mod speed_unit;
|
||||
mod temp_unit;
|
||||
|
||||
use billboard::{Alignment, Billboard};
|
||||
use current_weather_print_params::CurrentWeatherPrintParams;
|
||||
@@ -30,7 +31,9 @@ fn main() {
|
||||
all,
|
||||
is_day,
|
||||
temperature,
|
||||
temperature_unit,
|
||||
windspeed,
|
||||
speed_unit,
|
||||
winddirection,
|
||||
include_coords,
|
||||
include_city,
|
||||
@@ -84,7 +87,7 @@ fn main() {
|
||||
city = Some(coords["city"].as_str().unwrap().to_string());
|
||||
}
|
||||
|
||||
let result = request_current_weather(&coordinates);
|
||||
let result = request_current_weather(&coordinates, &temperature_unit, &speed_unit);
|
||||
let current_weather = result.unwrap_or_else(|_| {
|
||||
eprintln!(
|
||||
"[ERROR] Requesting CurrentWeather for Lat: {}, Lon: {}",
|
||||
@@ -97,14 +100,17 @@ fn main() {
|
||||
all,
|
||||
is_day,
|
||||
temperature,
|
||||
temperature_unit,
|
||||
windspeed,
|
||||
speed_unit,
|
||||
winddirection,
|
||||
include_coords,
|
||||
include_city,
|
||||
clean,
|
||||
);
|
||||
|
||||
let current_weather_printer = CurrentWeatherPrinter::new(current_weather, print_params, coordinates, city);
|
||||
let current_weather_printer =
|
||||
CurrentWeatherPrinter::new(current_weather, print_params, coordinates, city);
|
||||
let output = current_weather_printer.extract_string();
|
||||
if clean {
|
||||
println!("{output}");
|
||||
|
||||
Reference in New Issue
Block a user