Added TpLink Tapo power usage data GET route

This commit is contained in:
Jack Mechem 2026-05-21 15:24:23 -07:00
parent 05915aae30
commit fb9f39ce21
Signed by: jackmechem
SSH key fingerprint: SHA256:GjIjMAC33pzYOe+hWcX5uvgnPrVFAXSrquvt84AOJbU
7 changed files with 1365 additions and 44 deletions

View file

@ -92,3 +92,23 @@ pub struct LoadAvgStats {
pub five: f64,
pub fifteen: f64,
}
#[derive(Serialize)]
pub struct TapoDeviceData {
pub name: String,
pub ip: String,
pub alias: String,
pub model: String,
pub on: bool,
pub current_power_w: f64,
pub today_energy_wh: u64,
pub month_energy_wh: u64,
pub today_runtime_min: u64,
pub month_runtime_min: u64,
}
#[derive(Serialize)]
pub struct TapoPowerResponse {
pub timestamp: String,
pub devices: Vec<TapoDeviceData>,
}