This commit is contained in:
Mateusz Gruszczyński
2026-09-15 09:04:29 +02:00
parent 0a2fb8c6c7
commit 2ff310bdc5
37 changed files with 731 additions and 141 deletions
+9
View File
@@ -56,6 +56,15 @@ pub(crate) fn record_cumulative_energy_sample(
reset_detected,
};
state.db.add_energy_reading(&reading)?;
state.broadcast(
"energy.updated",
json!({
"target_id": reading.device_id.clone(),
"source": reading.source.clone(),
"total_kwh": reading.normalized_meter_kwh,
"timestamp": reading.timestamp,
}),
);
queue_influx_energy(state, reading.clone());
Ok(reading)
}