Record received consumption from inverter

This commit is contained in:
2024-09-23 21:47:25 +02:00
parent 0e0da14fde
commit 228e1a7293
9 changed files with 183 additions and 12 deletions

View File

@ -255,6 +255,18 @@ impl AppConfig {
pub fn relay_runtime_day_file_path(&self, relay_id: DeviceRelayID, day: u64) -> PathBuf {
self.relay_runtime_stats_dir(relay_id).join(day.to_string())
}
/// Get energy consumption history path
pub fn energy_consumption_history(&self) -> PathBuf {
self.storage_path().join("consumption_history")
}
/// Get energy consumption history file path for a given day
pub fn energy_consumption_history_day(&self, number: u64) -> PathBuf {
self.storage_path()
.join("consumption_history")
.join(number.to_string())
}
}
#[cfg(test)]