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

Method GetPlan

core/loadpoint_plan.go:110–119  ·  view source on GitHub ↗

GetPlan creates a charging plan for given time and duration The plan is sorted by time

(targetTime time.Time, requiredDuration, precondition time.Duration, continuous bool)

Source from the content-addressed store, hash-verified

108// GetPlan creates a charging plan for given time and duration
109// The plan is sorted by time
110func (lp *Loadpoint) GetPlan(targetTime time.Time, requiredDuration, precondition time.Duration, continuous bool) api.Rates {
111 if lp.planner == nil || targetTime.IsZero() {
112 return nil
113 }
114
115 lp.log.TRACE.Printf("plan: creating plan with continuous=%v, precondition=%v, duration=%v, target=%v",
116 continuous, precondition, requiredDuration.Round(time.Second), targetTime.Round(time.Second).Local())
117
118 return lp.planner.Plan(requiredDuration, precondition, targetTime, continuous)
119}
120
121// plannerActive checks if the charging plan has a currently active slot
122func (lp *Loadpoint) plannerActive() (active bool) {

Callers 1

plannerActiveMethod · 0.95

Calls 3

PrintfMethod · 0.80
PlanMethod · 0.80
IsZeroMethod · 0.45

Tested by

no test coverage detected