chore: cleanup

This commit is contained in:
andig 2022-12-11 17:21:42 +01:00
parent 31b179f27b
commit 96a6342f63
3 changed files with 0 additions and 27 deletions

View file

@ -398,19 +398,6 @@ func (c *CmdConfigure) processConfig(templateItem *templates.Template, deviceCat
c.processModbusConfig(templateItem, deviceCategory)
// TODO remove
// type mapped = struct {
// Name string
// Default any
// }
// fmt.Printf("%+v\n", lo.Map(templateItem.Params, func(p templates.Param, _ int) mapped {
// return mapped{
// Name: p.Name,
// Default: p.Default,
// }
// }))
return c.processParams(templateItem, deviceCategory)
}

View file

@ -41,9 +41,6 @@ func (s *DB) Session(meter float64) *Session {
// Persist creates or updates a transaction in the database
func (s *DB) Persist(session interface{}) {
// TODO remove
s.log.DEBUG.Printf("persist: %+v", session)
if err := s.db.Save(session).Error; err != nil {
s.log.ERROR.Printf("persist: %v", err)
}

View file

@ -41,9 +41,6 @@ func (lp *LoadPoint) createSession() {
lp.session.Identifier = id
}
}
// TODO remove
lp.log.DEBUG.Println("session started")
}
// stopSession ends a charging session segment and persists the session.
@ -55,8 +52,6 @@ func (lp *LoadPoint) stopSession() {
// abort the session if charging has never started
if lp.session.Created.IsZero() {
// TODO remove
lp.log.DEBUG.Println("session aborted")
return
}
@ -67,9 +62,6 @@ func (lp *LoadPoint) stopSession() {
lp.session.ChargedEnergy = chargedEnergy
}
// TODO remove
lp.log.DEBUG.Println("session stopped")
lp.db.Persist(lp.session)
}
@ -86,9 +78,6 @@ func (lp *LoadPoint) updateSession(opts ...sessionOption) {
opt(lp.session)
}
// TODO remove
lp.log.DEBUG.Println("session updated")
if !lp.session.Created.IsZero() {
lp.db.Persist(lp.session)
}