()
| 13 | ) |
| 14 | |
| 15 | func (lp *Loadpoint) chargeMeterTotal() float64 { |
| 16 | m, ok := api.Cap[api.MeterEnergy](lp.chargeMeter) |
| 17 | if !ok { |
| 18 | return 0 |
| 19 | } |
| 20 | |
| 21 | f, err := m.TotalEnergy() |
| 22 | if err != nil { |
| 23 | if !errors.Is(err, api.ErrNotAvailable) { |
| 24 | lp.log.ERROR.Printf("charge total import: %v", err) |
| 25 | } |
| 26 | return 0 |
| 27 | } |
| 28 | |
| 29 | lp.log.DEBUG.Printf("charge total import: %.3fkWh", f) |
| 30 | |
| 31 | return f |
| 32 | } |
| 33 | |
| 34 | // createSession creates a charging session. The created timestamp is empty until set by evChargeStartHandler. |
| 35 | // The session is not persisted yet. That will only happen when stopSession is called. |
no test coverage detected