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

Method evChargeStartHandler

core/loadpoint.go:503–525  ·  view source on GitHub ↗

evChargeStartHandler sends external start event

()

Source from the content-addressed store, hash-verified

501
502// evChargeStartHandler sends external start event
503func (lp *Loadpoint) evChargeStartHandler() {
504 lp.log.INFO.Println("start charging ->")
505 lp.pushEvent(evChargeStart)
506
507 // charge status
508 lp.publish(keys.ChargerStatusReason, api.ReasonUnknown)
509
510 lp.stopWakeUpTimer()
511
512 // soc update reset
513 lp.socUpdated = time.Time{}
514
515 // set created when first charging session segment starts
516 lp.updateSession(func(session *session.Session) {
517 if session.Created.IsZero() {
518 session.Created = lp.clock.Now()
519 }
520 // capture start soc once available (may not be present at session start)
521 if soc := lp.vehicleSoc; session.SocStart == nil && soc > 0 && !lp.chargerHasFeature(api.Heating) {
522 session.SocStart = &soc
523 }
524 })
525}
526
527// evChargeStopHandler sends external stop event
528func (lp *Loadpoint) evChargeStopHandler() {

Callers

nothing calls this directly

Calls 7

pushEventMethod · 0.95
publishMethod · 0.95
stopWakeUpTimerMethod · 0.95
updateSessionMethod · 0.95
chargerHasFeatureMethod · 0.95
PrintlnMethod · 0.80
IsZeroMethod · 0.45

Tested by

no test coverage detected