
use rocket::serde::{Deserialize, Serialize};

#[derive(Deserialize, Serialize)]
#[serde(crate = "rocket::serde")]
#[derive(Debug)]
pub struct SensorData { 
    pub id: Option<u32>,
    pub name: String,
    pub value: f32,
    pub unit: String,
}

// #[derive(Debug)]
pub fn get_sensor_data() -> SensorData {
    SensorData {
        id: Some(1),
        name: String::from("Sensor name"),
        value: 4.5,
        unit: String::from("C")
    }
}