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

Method updateSession

core/loadpoint_session.go:109–122  ·  view source on GitHub ↗

updateSession updates any parameter of a charging session and persists the session.

(opts ...sessionOption)

Source from the content-addressed store, hash-verified

107
108// updateSession updates any parameter of a charging session and persists the session.
109func (lp *Loadpoint) updateSession(opts ...sessionOption) {
110 // test guard
111 if lp.db == nil || lp.session == nil {
112 return
113 }
114
115 for _, opt := range opts {
116 opt(lp.session)
117 }
118
119 if !lp.session.Created.IsZero() {
120 lp.db.Persist(lp.session)
121 }
122}
123
124// clearSession clears the charging session without persisting it.
125func (lp *Loadpoint) clearSession() {

Callers 6

evChargeStartHandlerMethod · 0.95
setVehicleIdentifierMethod · 0.95
setActiveVehicleMethod · 0.95
vehicleOdometerMethod · 0.95
TestSessionFunction · 0.95
TestResetHeatingSessionFunction · 0.95

Calls 2

PersistMethod · 0.80
IsZeroMethod · 0.45

Tested by 2

TestSessionFunction · 0.76
TestResetHeatingSessionFunction · 0.76