MCPcopy Create free account
hub / github.com/evcc-io/evcc / chargeMeterTotal

Method chargeMeterTotal

core/loadpoint_session.go:15–32  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

13)
14
15func (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.

Callers 4

publishChargeProgressMethod · 0.95
createSessionMethod · 0.95
applyEnergyMetricsMethod · 0.95
BootMethod · 0.80

Calls 2

PrintfMethod · 0.80
TotalEnergyMethod · 0.65

Tested by

no test coverage detected