diff --git a/src/client/get_station_data.rs b/src/client/get_station_data.rs index c62577b..a560992 100644 --- a/src/client/get_station_data.rs +++ b/src/client/get_station_data.rs @@ -5,105 +5,105 @@ use std::collections::HashMap; #[derive(Debug, Serialize, Deserialize)] pub struct StationData { - body: Body, - status: String, - time_exec: f64, - time_server: u64, + pub body: Body, + pub status: String, + pub time_exec: f64, + pub time_server: u64, } #[derive(Debug, Serialize, Deserialize)] pub struct Body { - devices: Vec, - user: User, + pub devices: Vec, + pub user: User, } #[derive(Debug, Serialize, Deserialize)] pub struct Device { #[serde(rename = "_id")] - id: String, - co2_calibrating: bool, - date_setup: u64, - firmware: u64, - last_setup: u64, - last_status_store: u64, - last_upgrade: Option, - module_name: String, - reachable: bool, - station_name: String, + pub id: String, + pub co2_calibrating: bool, + pub date_setup: u64, + pub firmware: u64, + pub last_setup: u64, + pub last_status_store: u64, + pub last_upgrade: Option, + pub module_name: String, + pub reachable: bool, + pub station_name: String, #[serde(rename = "type")] - type_info: String, - wifi_status: f64, - dashboard_data: DashboardData, - data_type: Vec, - modules: Vec, - place: Place, + pub type_info: String, + pub wifi_status: f64, + pub dashboard_data: DashboardData, + pub data_type: Vec, + pub modules: Vec, + pub place: Place, } #[derive(Debug, Serialize, Deserialize)] pub struct DashboardData { #[serde(rename = "AbsolutePressure")] - absolute_pressure: Option, + pub absolute_pressure: Option, #[serde(rename = "CO2")] - co2: Option, + pub co2: Option, #[serde(rename = "Humidity")] - humidity: Option, + pub humidity: Option, #[serde(rename = "Noise")] - noise: Option, + pub noise: Option, #[serde(rename = "Pressure")] - pressure: Option, + pub pressure: Option, #[serde(rename = "Temperature")] - temperature: Option, - date_max_temp: Option, - date_min_temp: Option, - max_temp: Option, - min_temp: Option, - pressure_trend: Option, - temp_trend: Option, - time_utc: Option, + pub temperature: Option, + pub date_max_temp: Option, + pub date_min_temp: Option, + pub max_temp: Option, + pub min_temp: Option, + pub pressure_trend: Option, + pub temp_trend: Option, + pub time_utc: Option, } #[derive(Debug, Serialize, Deserialize)] pub struct Module { #[serde(rename = "_id")] - id: String, - battery_percent: u64, - battery_vp: u64, - dashboard_data: DashboardData, - data_type: Vec, - firmware: u64, - last_message: u64, - last_seen: u64, - last_setup: u64, - module_name: String, - reachable: bool, - rf_status: u64, + pub id: String, + pub battery_percent: u64, + pub battery_vp: u64, + pub dashboard_data: DashboardData, + pub data_type: Vec, + pub firmware: u64, + pub last_message: u64, + pub last_seen: u64, + pub last_setup: u64, + pub module_name: String, + pub reachable: bool, + pub rf_status: u64, #[serde(rename = "type")] - type_info: String, + pub type_info: String, } #[derive(Debug, Serialize, Deserialize)] pub struct Place { - altitude: u64, - city: String, - country: String, - location: Vec, - timezone: String, + pub altitude: u64, + pub city: String, + pub country: String, + pub location: Vec, + pub timezone: String, } #[derive(Debug, Serialize, Deserialize)] pub struct User { - administrative: Administrative, - mail: String, + pub administrative: Administrative, + pub mail: String, } #[derive(Debug, Serialize, Deserialize)] pub struct Administrative { - feel_like_algo: u64, - lang: String, - pressureunit: u64, - reg_locale: String, - unit: u64, - windunit: u64, + pub feel_like_algo: u64, + pub lang: String, + pub pressureunit: u64, + pub reg_locale: String, + pub unit: u64, + pub windunit: u64, } pub(crate) fn get_station_data(client: &AuthenticatedClient, device_id: &str) -> Result {