chore: add more session logging

This commit is contained in:
andig 2024-05-07 19:10:06 +02:00
parent 81ba7dcc29
commit 8ba04a6a22

View file

@ -63,6 +63,9 @@ func (lp *Loadpoint) stopSession() {
}
if chargedEnergy := lp.getChargedEnergy() / 1e3; chargedEnergy > s.ChargedEnergy {
{ // TODO remove
lp.log.DEBUG.Printf("session: chargedEnergy=%.1f", s.ChargedEnergy)
}
lp.sessionEnergy.Update(chargedEnergy)
}
@ -74,6 +77,17 @@ func (lp *Loadpoint) stopSession() {
s.ChargedEnergy = lp.sessionEnergy.TotalWh() / 1e3
s.ChargeDuration = &lp.chargeDuration
{ // TODO remove
var meterStart, meterStop float64
if s.MeterStart != nil {
meterStart = *s.MeterStart
}
if s.MeterStop != nil {
meterStop = *s.MeterStop
}
lp.log.DEBUG.Printf("session: start=%.3f stop=%.3f chargedEnergy=%.3f", meterStart, meterStop, s.ChargedEnergy)
}
lp.db.Persist(s)
}