rointe_core/models/energy.rs
1use serde::{Deserialize, Serialize};
2
3/// Hourly energy consumption data returned by the `history_statistics` endpoint.
4///
5/// Values may be `None` if the device has not reported data for the requested
6/// time slot. [`crate::RointeClient::get_energy_stats`] walks back up to five
7/// hours to find the most recent non-null record.
8#[derive(Debug, Clone, Serialize, Deserialize)]
9pub struct EnergyConsumptionData {
10 /// Energy consumed during the hour in kilowatt-hours.
11 pub kw_h: Option<f64>,
12
13 /// Effective (actual) power draw during the hour in watts.
14 pub effective_power: Option<u32>,
15}