Switch to floats for the current power and total energy fields
This commit is contained in:
parent
093d062dd4
commit
2883f52249
|
@ -41,9 +41,9 @@ struct Config {
|
|||
#[derive(Clone, Copy, Debug, Serialize)]
|
||||
struct Status {
|
||||
/// Current power production (W)
|
||||
current_w: u32,
|
||||
current_w: f32,
|
||||
/// Total energy produced since installation (kWh)
|
||||
total_kwh: u32,
|
||||
total_kwh: f32,
|
||||
/// Timestamp of last update
|
||||
last_updated: u64,
|
||||
}
|
||||
|
|
|
@ -119,8 +119,8 @@ impl super::Service for Service {
|
|||
};
|
||||
|
||||
Ok(Status {
|
||||
current_w: api_power.pv_now,
|
||||
total_kwh: api_energy.pv_to_date,
|
||||
current_w: api_power.pv_now as f32,
|
||||
total_kwh: api_energy.pv_to_date as f32,
|
||||
last_updated,
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue