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

Method resetHeatingSession

core/loadpoint_session.go:158–178  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

156}
157
158func (lp *Loadpoint) resetHeatingSession() {
159 if lp.session == nil || !lp.chargerHasFeature(api.Heating) || !lp.chargerHasFeature(api.IntegratedDevice) {
160 return
161 }
162
163 if !now.With(lp.clock.Now()).BeginningOfDay().After(lp.session.Created) {
164 return
165 }
166
167 lp.stopSession()
168 lp.clearSession()
169
170 if cr, ok := lp.chargeRater.(wrapper.ChargeResetter); ok {
171 cr.ResetCharge()
172 }
173 if ct, ok := lp.chargeTimer.(wrapper.ChargeResetter); ok {
174 ct.ResetCharge()
175 }
176
177 lp.createSession()
178}

Callers 2

UpdateMethod · 0.95
TestResetHeatingSessionFunction · 0.95

Calls 5

chargerHasFeatureMethod · 0.95
stopSessionMethod · 0.95
clearSessionMethod · 0.95
createSessionMethod · 0.95
ResetChargeMethod · 0.65

Tested by 1

TestResetHeatingSessionFunction · 0.76