Delete relay energy information

This commit is contained in:
2024-09-17 22:42:24 +02:00
parent 565db05fb0
commit 92878e6548
4 changed files with 27 additions and 6 deletions

View File

@ -315,6 +315,12 @@ impl DevicesList {
.into());
}
// Delete relay energy information
let stats_dir = AppConfig::get().relay_runtime_stats_dir(relay_id);
if stats_dir.is_dir() {
std::fs::remove_dir_all(stats_dir)?;
}
// Delete the relay
let device = self
.relay_get_device(relay_id)